View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Conan Kelly[_2_] Conan Kelly[_2_] is offline
external usenet poster
 
Posts: 5
Default Storing column references in a variable

Jim,

Sorry for not getting back to you sooner.

I tried your suggestion and it worked just fine.

Thanks again for your help,

Conan




"Jim Cone" wrote in message
...
Conan,

I changed the two lines marked by asterisks.
See if that meets your needs...
'-------------------------------
Range("A1").Select
Cells.Find(What:="Balance", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True).Activate
intLastCol = ActiveCell.Column + 1
Range(Columns(intLastCol), Columns(intLastCol + 6)).Select '*****
Selection.EntireColumn.Delete

Rows(intLastCol + 1 & "1").Select '*****
Selection.End(xlDown).Select
If ActiveCell.Row < 65536 Then
MsgBox "Still Data in this column. Please delete more columns.", _
vbOKOnly, "Error!!!!!!!!"
Exit Sub
End If
'--------------------------

Regards,
Jim Cone
San Francisco, USA