Need help guys...

Frozo

New Member
Joined
May 22, 2011
Messages
5
Hi guys
have a bunch of inserts and save ases that may take ages till ended

I need a Macro that inserts a Value "n" from a list in "sheet2" to a cell in "sheet1" and then saves a filename as this value "n" then proceeds to a next value in the column list in "sheet2" and stops as the list ends
thanks in advance..! :biggrin:
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Maybe something like this

Code:
Sub frozo()
Dim LR As Long, i As Long
With Sheets("Sheet2")
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To LR
        With .Range("A" & i)
            Sheets("Sheet1").Range("A1").Value = .Value
            ActiveWorkbook.SaveAs Filename:=.Value & ".xls"
        End With
    Next i
End With
End Sub
 
Upvote 0
Well, the filename list is a column not a row, so I think u ve done it for a row list
and I donno why I got a 1004 runtime error and then 13 runtime error
 
Upvote 0
Thaaaaaaaaaaaaanks a lot VOG...!!

Sub frozo()
Dim LR As Long, i As Long
With Sheets("Sheet2")
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = 4 To LR
With .Range("A" & i)
Sheets("Sheet1").Range("B3").Value = .Value
ActiveWorkbook.SaveAs Filename:="C:\Mohamed Docs\" & .Value & ".xls"
End With
Next i
End With
End Sub



it's working :laugh:
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top