View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Shailesh Shah[_2_] Shailesh Shah[_2_] is offline
external usenet poster
 
Posts: 114
Default Selecting multiple columns

Hi Alan,

Try something like this,

Sub SelectColumn(stcol As Integer, lastcol As Integer)

If lastcol = stcol And lastcol 0 And stcol 0 And stcol <= 256 And
lastcol <= 256 Then

Columns(stcol).Resize(, lastcol - stcol + 1).Select

Else
'for demo purpose

MsgBox "Couldn't select Col."

End If

End Sub

Sub test()
SelectColumn 1, 3 ' A-C
End Sub



Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!