From the course: Excel: Macros and VBA for Beginners

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Warnings about VBA and macros: Errors

Warnings about VBA and macros: Errors - Microsoft Excel Tutorial

From the course: Excel: Macros and VBA for Beginners

Start my 1-month free trial

Warnings about VBA and macros: Errors

- When VBA ain't working right, it can spit out some unhelpful errors. Let's take a look. Here I've got this data that needs to be processed. I'm going to click here and start recording a macro. Developer tab, record macro, name the macro, sort. I don't want a shortcut key. Okay. Now here are the steps in the macro. Go to data, sort. I want to sort this data three ways, so I'm going to add two more levels. I want to sort by total, largest to smallest, then by last name, then by first name. Okay. And then I want to retrieve the statuses from the codes tab. Over here I'm going to go, =VLOOKUP. Double click there. Look up what? Look up this ID, comma, look up the table array. Let's go down here. This is where I want to retrieve the data, and then F4 to lock down that range using the absolute cell references, comma, the column index, the second column, comma, false. Close parentheses, enter.…

Contents