ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   can i use one workbook to perform instructions i another (https://www.excelbanter.com/excel-discussion-misc-queries/188286-can-i-use-one-workbook-perform-instructions-i-another.html)

des-sa[_2_]

can i use one workbook to perform instructions i another
 
i was helped by so many people over the last few weeks that i created an
excellent solution to what was a huge problem in our company. now i would
want to hear if my next step is possible. what i did is to create a
quotation in a workbook that automatically number each new one consecutively
with a unique number and a lot more very useful functions you guys helped me
with. so the quote was given to the customer, now he accepts it. what i
would now like to do is to, from the original quote, to instruct the job card
(a new/other work book) to open, give the job card the same number and
entries in the quote. my questions:
1. how do i instruct, from say workbook "quote1487" a new workbook, by the
name of "jobcard1487" to open
2. how do i duplicate 5 or 6 ranges of cells in "quote1487" in the new
workbook "jobcard1487".
thank you

Bernie Deitrick

can i use one workbook to perform instructions i another
 
A lot depends on your naming convention (are there always 4 digits?) and which range you want to
copy (and whether you want to copy and paste values, or formats, or formulas...) but this is the
general approach, with the code in quote1487

Dim myB As Workbook
Set myB = Workbooks.Add
myB.SaveAs Thisworkbook.Path & "\jobcard" & Right(Thisworkbook.Name, 8)
Thisworkbook.Worksheets("Sheet1").RAnge("A1:A6").C opy _
myB.Worksheets(1).Range("A1:A6")
myB.Save

HTH,
Bernie
MS Excel MVP


"des-sa" wrote in message
...
i was helped by so many people over the last few weeks that i created an
excellent solution to what was a huge problem in our company. now i would
want to hear if my next step is possible. what i did is to create a
quotation in a workbook that automatically number each new one consecutively
with a unique number and a lot more very useful functions you guys helped me
with. so the quote was given to the customer, now he accepts it. what i
would now like to do is to, from the original quote, to instruct the job card
(a new/other work book) to open, give the job card the same number and
entries in the quote. my questions:
1. how do i instruct, from say workbook "quote1487" a new workbook, by the
name of "jobcard1487" to open
2. how do i duplicate 5 or 6 ranges of cells in "quote1487" in the new
workbook "jobcard1487".
thank you





All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com