Copy and save to another sheet

posfog

Board Regular
Joined
Jun 2, 2009
Messages
171
Morning All,
I have a forumla that copy a line from one tab and then pastes it to a different tab within the same workbook then saves the file. But i wondered if its possible for the formula to paste the data to a totally different work book and then save that file ?

I have copied a watered down version of the formula with the only thing thats missing is the amount of lines its copying across

Sub ADDRECORD()
Dim src As Worksheet
Dim dst As Worksheet
Dim rw As Long
Application.ScreenUpdating = False
' Set source and destination sheets
Set src = Sheets("TOUCH SCREEN")
Set dst = Sheets("RAW DATA")
' Find next available row on destination sheet
rw = dst.Cells(Rows.Count, "A").End(xlUp).Row + 1
' Check M4
If src.Range("M4") = "Select Variant" Then
MsgBox "Tab " & src.Name & " contains 'Select Variant'", vbInformation, "Select Variant found..."
ElseIf dst.Range("M4") = "Select Variant" Then
MsgBox "Tab " & dst.Name & "contains 'Select Variant'", vbInformation, "Select Variant found..."
End If
' Populate values on destination sheet
dst.Cells(rw, "A") = src.Range("A101")
dst.Cells(rw, "B") = src.Range("B101")
Application.ScreenUpdating = True
Save Workbook
ActiveWorkbook.Save


End Sub

Kind Regards
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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