VBA - select a range based on cell content

Nomadscot

Registered User.
Local time
Today, 07:00
Joined
Apr 9, 2014
Messages
26
Good Morning all,

Can someone please tell me if it possible to select a range of cells (which are to be cleared), the starting cell of which depends on whether or not a cell has a value in it?

For example, if cell A56 is not populated then I would like VBA code to select range A56:T167.

If Cell A56 IS populated, then I would like VBA code to select Range A112:T167

Possible?

Many thanks in advance for any assistance provided.
 
yes very possible... something along the lines of
if isnull(range("A56")) or range("A56") = "" then
range("A56:T167").clearcontents
else
'clear other range
endif
 
Wonderful -works perfectly for what I want to do.

Thank you so much.

:)
 

Users who are viewing this thread

Back
Top Bottom