Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus 123 Script

Status
Not open for further replies.

LokiStan

Technical User
Mar 2, 2001
1
US
I need a simple script to run through 10,000 lines of the following:

label1 [empty column] label3 label4 label5 label6
label2

I would like the macro/script to place the label2 in the empty column slot and run from line 1 to line 10,000. Any help would be appreciated
 
Hi LokiStan,

Try this script it should get you close to what you want. You may have to do some modifications. My suggestion (note: I'm using Lotus 123 R9.5. I'm not sure of compatiblities.) is to copy this script into the script editor and use the "Record at cursor" feature to modify it in any way you need.

Sub movetocol2
For i = 1 To 10000 Step 2
[A:A1..A:b10000].cell(i,0).Select
Selection.CopyToClipboard
Selection.Clear ClearData
[A:A1..A:b10000].cell(i - 1,1).Select
Selection.Paste ,,,,,,
Next i
End Sub

Some things to point out, you can make the number of steps in the loop a variable that is easily changed. (If you do this be sure to change the B10000 to the same number, as long as it is less than approx 65500. This is the max number of rows 123 supports.) The .cell(rowOffset,colOffset) notation is very similar to Excel's(VBA) .Offset(rowOffset,colOffset) notation. You will get an error though if the cell you select is outside the bracketed range. (Example: [A:A1].cell(1,1).select would try to select cell [A:B2] which is not with in the [A:A1] range and would return an error.)

Hope this helps!!!

BBord
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top