If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Adding on excel
Well I am confused as it works fine here, and there doesn't seem to be any
syntax mistakes in what you show. Syntax errors usually show when you enter the code, not when you run it. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Laura ( '_' )" wrote in message ... Okay thanks Bob. I did what you asked, but when I type in A2, I get an error message "Syntax error". Then the top line of the code you gave me highlights yellow. This is how i have it in my spreadsheet: Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "$A$2" On Error GoTo ws_exit: Application.EnableEvents = False If Target.Address = WS_RANGE Then With Target. Offset(1, 0).Value = .Value + .Offset(1, 0).Value End With End If ws_exit: Application.EnableEvents = True End Sub Thanks,you've been very helpful so far -- @---}-- Laura..... Liverpool, England "Bob Phillips" wrote in message ... Open the worksheet it is to apply to, follow the instructions at the end of the code, go back to the worksheet and put some numbers in A2. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Laura ( '_' )" wrote in message ... Hiya, Im sorry but i really dont have a clue what that is or what to do with it. Im sorry but im very very new :-S -- @---}-- Laura..... Liverpool, England "Bob Phillips" wrote in message ... A code solution Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "$A$2" On Error GoTo ws_exit: Application.EnableEvents = False If Target.Address = WS_RANGE Then With Target .Offset(1, 0).Value = .Value + .Offset(1, 0).Value End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Laura ( '_' )" wrote in message ... Excel 2000 Hiya, I have a question for all you brainboxes out there! Im VERY new to excel so please explain clearly or I'll be completley lost!! In the cell A3 I would like to have a "Grand Total". In the cell A2, I would like to enter a number, eg. 400 (this would then appear in A3 as 400), THEN I would like to enter another number, eg. 307 in cell A2. (this wouuld then appear in A3 as 707). I hope that explains it, I find it a bit confusing. Thanks for any help you can offer -- @---}-- Laura..... Liverpool, England |
#12
|
|||
|
|||
Adding on excel
Laura ( '_' ) wrote...
Okay thanks Bob. I did what you asked, but when I type in A2, I get an error message "Syntax error". Then the top line of the code you gave me highlights yellow. This is how i have it in my spreadsheet: Private Sub Worksheet_Change(ByVal Target As Range) .... With Target. .... The problem is the period following Target in the line above. Remove the period. |
#13
|
|||
|
|||
Adding on excel
Didn't spot that, I wonder how she did that.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Harlan Grove" wrote in message oups.com... Laura ( '_' ) wrote... Okay thanks Bob. I did what you asked, but when I type in A2, I get an error message "Syntax error". Then the top line of the code you gave me highlights yellow. This is how i have it in my spreadsheet: Private Sub Worksheet_Change(ByVal Target As Range) ... With Target. ... The problem is the period following Target in the line above. Remove the period. |
#14
|
|||
|
|||
Adding on excel
"Harlan Grove" wrote in message
oups.com... The problem is the period following Target in the line above. Remove the period. ??? the period should be before the Offset not just removed from the Target otherwise it stops with a "Sub or function not defined" error (But then you knew that g) -- Regards Sandy with @tiscali.co.uk " |
#15
|
|||
|
|||
Adding on excel
Sandy Mann wrote...
"Harlan Grove" wrote in message .... The problem is the period following Target in the line above. Remove the period. ??? the period should be before the Offset not just removed from the Target otherwise it stops with a "Sub or function not defined" error (But then you knew that g) Know, maybe. Noticed, unfortunately not. Sometimes can only handle one bug at a time. |
#16
|
|||
|
|||
Adding on excel
arent we all getting a bit carried away?in A3 type=sum(A1:A2)
-- paul remove nospam for email addy! "Laura ( '_' )" wrote: Excel 2000 Hiya, I have a question for all you brainboxes out there! Im VERY new to excel so please explain clearly or I'll be completley lost!! In the cell A3 I would like to have a "Grand Total". In the cell A2, I would like to enter a number, eg. 400 (this would then appear in A3 as 400), THEN I would like to enter another number, eg. 307 in cell A2. (this wouuld then appear in A3 as 707). I hope that explains it, I find it a bit confusing. Thanks for any help you can offer -- @---}-- Laura..... Liverpool, England |
#17
|
|||
|
|||
Adding on excel
arent we all getting a bit carried away? ..
Think it was the OP's office boss who insisted on having it done in just one cell g (OP explained in reply to Stefi) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- |
#18
|
|||
|
|||
Adding on excel
Yep thats right it was my demon boss vbg
Anyway I've got it all sorted now, so a HUGE thanks to everyone who helped, you saved my life! :-D -- @---}-- Laura..... Liverpool, England "Max" wrote in message ... arent we all getting a bit carried away? .. Think it was the OP's office boss who insisted on having it done in just one cell g (OP explained in reply to Stefi) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can we import an Excel sheet to use as base for report? | StargateFan | New Users | 9 | November 4th, 2005 07:32 PM |
Adding a Menu Item to Main Menu Problem in Excel | Jack Gillis | General Discussions | 1 | February 28th, 2005 04:03 PM |
Excel Link: Adding rows in Excel does not add cells in Word | Jameslp | Tables | 2 | December 9th, 2004 07:18 PM |
URGENT! Excel adding decimal places and #'s | Rebecca | General Discussion | 1 | October 1st, 2004 11:32 PM |
Excel adding numbers incorrectly | Jazz | General Discussions | 2 | May 21st, 2004 02:36 AM |