R
randy.gooch
I have a macro which selects to the last field within a given range
which has data greater than zero. I have tried to use this macro in
another macro to reselect the range and set print range for printing.
After running the macro the first time, it hard codes the set print
range and will not change it after that. I need the Application.Run
"'09RadLabPath.xls'!Sheet3.find_it" in the code below to run each
time
and then have the set print range be updated which might be different
than the $AM$34. I am also including the code for the Find It macro
at the end. Please let me know if you can help resolve this issue.
Thanks!
Randy
Sub RLP802PrintServices()
'
' RLP802PrintServices Macro
' Macro recorded 4/4/2008 by
'
'
ActiveWorkbook.CustomViews("RLP-802 Print Services View").Show
Application.Run "'09RadLabPath.xls'!Sheet3.find_it"
ActiveSheet.PageSetup.PrintArea = "$D$12:$AM$34"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.Run "'09RadLabPath.xls'!RLP802OriginalView"
End Sub
Sub find_it()
endcell = 0
Set rGoTo = Range("D12")
Set r = Range("D12:AN112")
For Each rr In r
If rr.Value = 0 Then
Else
endcell = rr.Address
Set rGoTo = rr
End If
Next
Range("D12:" & endcell).Select
End Sub
which has data greater than zero. I have tried to use this macro in
another macro to reselect the range and set print range for printing.
After running the macro the first time, it hard codes the set print
range and will not change it after that. I need the Application.Run
"'09RadLabPath.xls'!Sheet3.find_it" in the code below to run each
time
and then have the set print range be updated which might be different
than the $AM$34. I am also including the code for the Find It macro
at the end. Please let me know if you can help resolve this issue.
Thanks!
Randy
Sub RLP802PrintServices()
'
' RLP802PrintServices Macro
' Macro recorded 4/4/2008 by
'
'
ActiveWorkbook.CustomViews("RLP-802 Print Services View").Show
Application.Run "'09RadLabPath.xls'!Sheet3.find_it"
ActiveSheet.PageSetup.PrintArea = "$D$12:$AM$34"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.Run "'09RadLabPath.xls'!RLP802OriginalView"
End Sub
Sub find_it()
endcell = 0
Set rGoTo = Range("D12")
Set r = Range("D12:AN112")
For Each rr In r
If rr.Value = 0 Then
Else
endcell = rr.Address
Set rGoTo = rr
End If
Next
Range("D12:" & endcell).Select
End Sub