![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Mar 2002
Location: Yuba City, Ca.
Posts: 16
|
daleyman gave me this formula
Private Sub Workbook_sheetActivate(ByVal Sh As Object) Sh.Range("ba37")=Sheets("source_sheet_name").Range("ba41") End Sub I can`t get the xxxx thing to work for me, what I`m trying to do is get my total number cell (ba41) to go to the subtotal cell (ba37) when I create a new sheet, and to do the same thing each day I made a new sheet. Thankx. [ This Message was edited by: rdrum on 2002-03-30 07:28 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
1) Where have you put the code should go into the Thisworkbook object eg Alt F11 > Ctrl + R > double click Thisworkbook Paste code 2) Have you referenced the name of the sheet in the code ?? currently you have "source_sheet_name" Ivan |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: London, UK
Posts: 167
|
my understanding is that you have a value in a set constant sheet, for example called "source_sheet_name" which you can substitute for the sheet name of your choice, at cell BA41, which you want appended to cell BA37 of any new sheet.
send me the workbook i may have a better idea... david@monnetqos.com |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Perhaps te code should be....
Private Sub Workbook_NewSheet(ByVal Sh As Object) Sh.Range("ba37") = Sheets("source_sheet_name").Range("ba41") End Sub Applied to the 2 pts I gave above ?? since you want it to run when you add a new sheet.... Ivan |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|