ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop Issues (https://www.excelbanter.com/excel-programming/354242-loop-issues.html)

bigfatdummy

Loop Issues
 

Little help on this loop will be greatly appreciated.

Sub Get_Values()

Dim Code As Variant
Dim Rows As Variant
Dim Counter As Variant

Sheets("Summary").Select
Range("B2").Activate
Code = ActiveCell

Sheets("Summary").Select
Range("B69").Activate
Rows = ActiveCell

Counter = 1

Do
Do While Counter < Rows
Counter = Counter + 1
If Counter < Rows Then GoTo Option1 Else GoTo Option2
Exit Do

Option1:
ActiveCell.Formula = "='" & Code & "'!G43"


Option2:
Loop
Loop Until Counter = Rows

End Sub


--
bigfatdummy
------------------------------------------------------------------------
bigfatdummy's Profile: http://www.excelforum.com/member.php...o&userid=31876
View this thread: http://www.excelforum.com/showthread...hreadid=516040



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com