Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default VBA Loop Help

What I am trying to do with this macro is concatenate G1 & B(Whatever
row is selected) & G2. So for instance I woudl like G4 to = G1 & B4 &
G2. Then go to G5 and that woudl be G1 & B5 & G2. I woudl like to do
this through a loop. I am sure the loop part is right, it is just the
stuff int he middle that is messed up.

Thank you,
Jay
Here is my code

Sub Monkey()

Dim G1 As Range
Dim G2 As Range

Set G1 = Range("G1")
Set G2 = Range("G2")

Dim nextRow As Long
nextRow = Selection.Row

Do Until Selection.Offset(0, -5) = ""
Selection = G1 & Range("B" & nextRow) & G2
Selection.Offset(1, 0).Select
Loop

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
How to loop saman110 via OfficeKB.com Excel Discussion (Misc queries) 4 July 25th 07 01:09 AM
Using a for loop Jeff Excel Discussion (Misc queries) 1 November 8th 06 09:27 PM
Loop Heather O'Malley Excel Discussion (Misc queries) 1 November 6th 06 02:39 PM
Any way to loop this in VBA? Bill (Unique as my name) Excel Discussion (Misc queries) 5 February 22nd 06 11:04 PM
Do Loop BobBarker Excel Worksheet Functions 0 August 19th 05 08:44 PM


All times are GMT +1. The time now is 02:15 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"