View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Aria[_2_] Aria[_2_] is offline
external usenet poster
 
Posts: 34
Default Find & Delete columns to the left stopping at column B

Don,
Yes, I'm assuming that there is only one Jan throughout the document. I
tried putting in a message prior to the deletion but when I run it
again, the same message appears. Any way to stop the message from
appearing, if "Jan" is already situated in column B?


Dim mbox As Button
x = Cells.Find("Jan-*").Column - 1
If x < 1 Then
mbox = MsgBox(Prompt:="Jan will shift to column B", _
Buttons:=vbOKOnly)
Range(Cells(1, 2), Cells(1, x)).EntireColumn.delete
End If

Thanks a bunch,
Aria

*** Sent via Developersdex http://www.developersdex.com ***