dudematters21
New Member
- Joined
- Oct 12, 2024
- Messages
- 10
- Office Version
- 365
hello good day masters!
my first post here, thank you for the help in advanced
i have recorded a macro to extract a sheet then paste it another workbook
my question is can we add a code werein i can save this using file name based on a cell value
lets say -- "K4" has a text saying ABCDE, so I want to save it using that name.. ofcourse this value constantly changes
so far this is the code that came up..
i hope there's a solution..
Sub Xtract ()
Sheets ("Sheet1").Select
Range("B1:C3").Select
Selection.Copy
Range ("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet2").Select
Application.CutCopyMode = False
Sheets("Sheet2").Copy
Range("E1:F1").Select
Selection.Copy
Application.CutCopyMode = False
ActiveWorkBook.SavaAs Filename:="H:\FFFF.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup=False
Windows("MAIN.xlsb.xlsm").Activate
Range("A6").Select
End Sub
my first post here, thank you for the help in advanced
i have recorded a macro to extract a sheet then paste it another workbook
my question is can we add a code werein i can save this using file name based on a cell value
lets say -- "K4" has a text saying ABCDE, so I want to save it using that name.. ofcourse this value constantly changes
so far this is the code that came up..
i hope there's a solution..
Sub Xtract ()
Sheets ("Sheet1").Select
Range("B1:C3").Select
Selection.Copy
Range ("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet2").Select
Application.CutCopyMode = False
Sheets("Sheet2").Copy
Range("E1:F1").Select
Selection.Copy
Application.CutCopyMode = False
ActiveWorkBook.SavaAs Filename:="H:\FFFF.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup=False
Windows("MAIN.xlsb.xlsm").Activate
Range("A6").Select
End Sub