What replaces Dim in Google Sheets?

Dim declares variables in VBA. In Apps Script, declare values with const for constants and let for values that change. Google Sheets macros and triggers are JavaScript, not Visual Basic, so syntax differs even when the spreadsheet ideas match.

When to use it

Use const and let when translating VBA Dim lines into Apps Script.

When to skip it

Skip manual ports when the macro recorder already generated working script.

Better Sheets resources

Related Tutorials

Watch how Dim works

Browse more tutorials
The First Thing I Do When Starting a Google Sheet

The First Thing I Do When Starting a Google Sheet

Are you tired of the default look of your Google Sheets? In this video, ...
5 Ways To Use Google Sheets for Advanced Project Management

5 Ways To Use Google Sheets for Advanced Project Management

Here are 5 advanced ways to manage projects inside of Google Sheets Man...
Convert Google Sheets into a REST API

Convert Google Sheets into a REST API

How to use Google Sheets as a database by turning it into a REST API wit...
Google Sheets Easter Eggs Beyond PRIDE

Google Sheets Easter Eggs Beyond PRIDE

Going beyond PRIDE, to show you some undocumented google sheets hacks th...
Scrape Google Maps

Scrape Google Maps

Scrape any query in Google Maps into your Google Sheets. Enter your API ...
Embed a Number in a Website from a Google Sheet

Embed a Number in a Website from a Google Sheet

Ever wanted to display some data from a google sheet on your site? Witho...

Related blog posts

Guides that explain Dim in more depth.

Browse the blog

Related terms

Done reading about Dim?

Membership unlocks 637+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.