View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Darin Kramer Darin Kramer is offline
external usenet poster
 
Posts: 397
Default Hiding unused columns



Howdie,

Im trying to go from column BY all the way to the left till first column
of data is found. Then hide all columns one to the right of the last
found column.
Eg data in column g, then want to hide H to BY. (columns with data will
vary. End point is always BY)

VB below almost works - it just hides last column with data in it (ie
column G) as well, and I need it to hide column H

Sub test

Application.Goto Reference:="R1C77"
Columns("BY:BY").Select
Range(selection, selection.End(xlToLeft)).Select
selection.EntireColumn.Hidden = True

End sub

Thanks

Darin



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