View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ozbobeee[_2_] Ozbobeee[_2_] is offline
external usenet poster
 
Posts: 11
Default If Value in Range then Delete Column

Hi,

I have values in the range C1:J149 on Sheet 2.
Via code, I wish to look at the values in the range C1:J1 and if the
value is also in the range D27:D34 on Sheet 1, then delete the
respective column accomodating that value in Sheet 2.

Other Info:
Both ranges are dynamic, in that not all cells will have values.


eg
Sheet 2 Range "C1" = 200535
Sheet 2 Range "D1" = 200536
Sheet 2 Range "E1" = 200537
Sheet 1 Range "D27" = 200535
Sheet 1 Range "D28" = 200536

Result:
Sheet 2 Column "C" (200535) deleted.
Sheet 2 Column "D" (200536) deleted.

All other data in Sheet 2 remains intact.


Any help appreciated.

Cheers

Bob