Macro Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) paste in ThisWorkbook module: Option Explicit Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal...
I am trying dummy now so I hope I'll get what I need. Thanks!!
I can't help you anymore. Hope you can find the cause of error on your own
You can create similar file with dummy data I don't think it is difficult Can you point to the line...
I cannot upload a file, at least I don't see permission for that :)
You're welcome It will be better to upload sample of your workbook to see the error .. Try to declare...
Thank you! It runs, Ill try some others stuff that I need to add for matching, but I have another...
You're welcome Glad I can offer some help
I have used the forum and found ‘Copy Data from one Worksheet to Another in Excel VBA’ which worked fantastic, using the below code:
I liked this code as it kept the comments I had inserted on the tabs and copied them to ‘Sheet 2’
What I would like to do, is copy Sheet 1 in exactly the same way, and when running the macro, Save as a new file (acting as a copy).
Can anyone help me please? I only want to save a range of the sheet 1 data, which is why I am not using a macro to save a copy of the sheet.
I did have this code:
Dim wbI As Workbook, wbO As Workbook
Dim wsI As Worksheet, wsO As Worksheet
‘~~> Source/Input Workbook
Set wbI = ThisWorkbook
‘~~> Set the relevant sheet from where you want to copy
Set wsI = wbI.Sheets(“Sheet1”)
‘~~> Destination/Output Workbook
Set wbO = Workbooks.Add
‘~~> Set the relevant sheet to where you want to paste
Set wsO = wbO.Sheets(“Sheet1″)
‘~~>. Save the file
.SaveAs Filename:=”C:\Desktop\Customer Copy.xlsm”, FileFormat:=56
‘~~> Copy the range
‘~~> Paste it in say Cell A2. Change as applicable
wsO.Range(“A2”).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
Which saves as a new file which is great, but it looses the inserted comments I had.
Please share using the share button above.
If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.
Found the answer useful and wants to credit the user, then vote the answer (vote up).