![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 473
|
I have two Workbooks (Quote.xls and number.xls)
Quote.xls contains a Worksheet called CopySheet . Cell C8 in CopySheet contains a number (say 1000) which is generated from Sheet1 Cell A1 in Number.xls. We have Quote.xls open I need a macro in Workbook Quote.xls which will :- a) Open number.xls (file location is q:newquotesystem) b) Look at Sheet 1 Cell A1 . c) Increment the number in Cell A1 by 1 d) Copy the contents of A1 to Cell C8 in worksheet "CopySheet" in Workbook Quote.xls e) Save & Close Workbook Number.xls f) Return to CopySheet in Workbook Quote.xls All help appreciated Ted |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi Ted
I did not test this, but see if it works for you. Cheers! Sub TedsSub() Workbooks.Open "q:newquotesystemNumber.xls" Sheet1.Range("A1").Value = Sheet1.Range("A1").Value + 1 Workbooks("Quote.xls").Sheets("CopySheet").Range("C8").Value = _ Sheet1.Range("A1").Value ActiveWorkbook.Close savechanges:=True Sheets("CopySheet").Activate End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Ahmedabad Gujarat
Posts: 303
|
Sub assignvalue()
Application.ScreenUpdating = False Workbooks.Open Filename:="c:my documentsnumbering.xls" Workbooks("numbering").Activate Worksheets("sheet1").Select workbooks("numbering").worksheets("sheetname").select [a8] = [a8]+1 range("a8").EntireRow.Copy Workbooks("quote").Worksheets("Sheet1").Range(c8) Workbooks("numbering").Close Application.ScreenUpdating = True End Sub I have not checked the code... but it should work. if you have problem then.. write back to me. nishith deai http://www.pexcel.com |
|
|
|
|
|
#4 | |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|