Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
When i step through this it works perfectly. However when i run it it only returns the first "i" for each any thoughts? Sub PrintEmOut() Dim MyRange As Range Dim WS As Worksheet Dim Lastrow As Long Dim i As Variant Set WS = ActiveWorkbook.Worksheets(2) Lastrow = WS.Cells(Cells.Rows.Count, "B").End(xlUp).Row Set MyRange = WS.Range("B2:B" & Lastrow) For Each i In MyRange With Worksheets(1) .Label1.Caption = i .Label2.Caption = i.Offset(0, 13).Value .Label3.Caption = i.Offset(0, 11).Value .PrintPreview .Label1.Caption = "" .Label2.Caption = "" .Label3.Caption = "" End With Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stepping through gives different result than running | Excel Programming | |||
BreakLinks method works when Stepping Through but not when Running! | Excel Programming | |||
Error Message When running code but not stepping through it. | Excel Programming | |||
VBA Code works by stepping through, not by running | Excel Programming | |||
Stepping through code gives different results than running it! | Excel Programming |