Macro line to check if column is blank

aa2000

Board Regular
Joined
Aug 3, 2011
Messages
87
Hi guys

In my project, I only want a certain If command to run in a particular column has at least one non blank cell in it. So if column J has a value in it, then I want this If command to run.

I tried the following code but got runtime error 13:

Code:
If Columns(10) <> "" Then
    If... Then...
End If

Is there a way of getting the first If command to check if the column is blank before running the next If?

Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Thanks for the quick response Villy. Correct me if I'm wrong, but does this code check if the cell is empty then calls the If command?

Is it possible to call the If command only if column J has values in it?

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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