LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default beginning programming: stop when last column in sheet

Please help: I would like to change the hard coded 10 in the for loop to a
variable that represents the last column in the sheet.


Sub Macro1()
Worksheets(1).Activate

For i = 1 To 10

Worksheets(1)Columns(i).Select

Selection.TextToColumns , DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 2), Array(20, 1)),
TrailingMinusNumbers:=True

ActiveCell.Offset(columnOffset:=1).Select

Next i

End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Stop Excel Removing Zero at beginning of number bird007 Excel Discussion (Misc queries) 1 February 19th 07 07:44 AM
Stop Excel from dropping the 0 in the beginning of a number Mo Setting up and Configuration of Excel 2 February 4th 06 07:12 PM
need enter key to move to the next column beginning j pantozzi Excel Worksheet Functions 2 December 5th 05 04:57 PM
Add a alphabetic character to the beginning of an entire column of Karise Excel Discussion (Misc queries) 1 August 18th 05 10:24 PM


All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"