IsEmpty Compile Error

Russj62

New Member
Joined
Aug 5, 2008
Messages
44
I am trying to recreate the IsEmpty macro on page 69 of "VBA and Macros for Microsoft Office Excel 2007" but I am getting a compile error on IsEmpty. I am sure that I have a very obvious (to others) problem but can not identify what is wrong.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Here it is:


Sub IsEmpty()
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To LastRow
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1).Resize(1, 4).Inteior.ColorIndex = 1
End If
Next i
 
You can't call the sub "IsEmpty" - because that's the name of a function in Excel.
Because you did call it IsEmpty - Excel expects your call within the code to be referncing the sub itself, which has no arguments.

Call the Sub ColorBlankRows - as it is in the sample files that you can download
You also spelled Interior wrong.
 

Forum statistics

Threads
1,222,720
Messages
6,167,837
Members
452,147
Latest member
Ckaplan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top