Hiyall!
I am new to excel macros and vba however willing to learn. Recently I came up with an idea to make specific macro decribed in the topic. Let me explain:
INPUT:
1 list with template style and fill of columns (numbers and formulas) 2 list for lookup function 3 output list
PROCESS: -start loop -for i to end_column on list2 create new list with name =Ai from list2 copy columns from list1 after copying cells with formulas replace every x with =Bi from list2 -save list csv
Yet I have found only saving as .csv, though it casuses error in path, like "impossible path"
Sub SplitSheets2()
Dim s As Worksheet
Dim wb as Workbook
Set wb = ActiveWorkbook
For Each s In wb.Worksheets
s.Copy
ActiveWorkbook.SaveAs wb.Path & "\" & s.Name & ".xlsx", FileFormat:=24
End Sub
where can I find other pieces? And how to make path work?
============= 14h edit I came up with the following code, but it has errors and more questions in comments
Dim c As Range
For Each c In Sheets("reference").Range("A2:A4")
Sheets.Add After:=ActiveSheet
Sheets("List2").Name = "123" '123 to change onto =ref!R3A2b but have "out of range error"
Sheets("temp").Select
Range("A1:D3").Select
Selection.Copy
Sheets("123").Select 'how do I select =ref!R3C2 list againg w/o looking up its name on ref list?
ActiveSheet.Paste
Range("C2").Select
Application.CutCopyMode = False 'dont know yet what does that mean, yet I was only changing formula
ActiveCell.FormulaR1C1 = "=reference!R3C2+1"
Selection.AutoFill Destination:=Range("C2:C3"), Type:=xlFillDefault 'idk also how Type:= appeared
Range("D2").Select
ActiveCell.FormulaR1C1 = "=reference!R3C3*2"
Selection.AutoFill Destination:=Range("D2:D3")
Range("D2:D3").Select
End Sub