Need help copying data from open workbook to closed workbook

Lil Stinker

Board Regular
Joined
Feb 16, 2022
Messages
151
Office Version
  1. 2019
Platform
  1. Windows
Howdy,
Currently I have this set up on two worksheets in the same workbook. One worksheet is used to create a quote. The other worksheet is the Quote Record. I would like to separate the two into different workbooks and have the Quote Record workbook automatically update as the quote is saved in the Quotes workbook.

It's not a big deal if both workbooks need to remain opened in order to update as long as the Quote Record workbook is closed after updating. Ideally, it would be better to have the Quote Record update without needing to open at all. The fewer windows open the better.

Below is the VBA I currently have to run the process of updating the Quote Record worksheet from the Quote worksheet. How do I manipulate this to achieve what I'm looking for?

Sub QuoteRecord()

Dim qtno As String
Dim custname As String
Dim projname As String
Dim amt As Currency
Dim dt_issue As Date
Dim dt_due As Date
Dim nextrec As Range

qtno = Range("J1").Value & Range("K1").Value
custname = Range("B3")
projname = Range("B2")
amt = Range("K40")
dt_issue = Range("K4")
If IsEmpty(Range("E9").Value) = True Then 'If empty take value E27 else E9
dt_due = Range("E27")
Else
dt_due = Range("E9")
End If


Set nextrec = Sheet4.Range("A1048576").End(xlUp).Offset(1, 0)

nextrec = qtno
nextrec.Offset(0, 1) = custname
nextrec.Offset(0, 2) = projname
nextrec.Offset(0, 3) = amt
nextrec.Offset(0, 4) = dt_issue
nextrec.Offset(0, 5) = dt_due


End Sub
 

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,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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