Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have a loop statement where i want to loop through the values in the
range on the sheet "Lists" cells a2:a70 and set the value of "report items location" cell a1 to this value, calculate, save as this value and loop. i have so far:- Sub loopthroughrangeandsave() Dim nameofile As String For Counter = 2 To 70 Set curCell = Worksheets("Lists").Cells(Counter, 3) ' Set curCell = Worksheets("Lists").Cells(Counter, 3) curCell.Copy Sheets("report items location").Select Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.Calculate Set nameofile = curCell activebook.SaveAs Filename:=nameofile 'SaveAs (Filename) Next Counter End Sub but this fails on the line activebook.SaveAs Filename:=nameofile 'SaveAs (Filename) saying object required? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming |