+ Reply to Thread
Results 1 to 5 of 5

help with If Isnumeric

  1. #1
    Registered User
    Join Date
    04-29-2004
    Posts
    92

    Help with IF ISNUMERIC and understanding the fundamentals behind it.

    Ok, This has really been a thorn in my side. It seems there should be an easy way to do this through excel but since I havent been able to find how I've turned to vba.

    Heres what I have.

    if isnumeric(sheets("sales 2").range("e11")) then
    Sheets("sales 2").range("g11") = Sheets("sales 2").range ("g11") _
    + Sheets("sales 2"). range(e12)

    What this does is it takes the inputed number from collum g adds it to collum e, basically keeping e updated on a daily basis. If this can be done somehow with a circular refrence please let me know.

    Sure this way works, but its totally flawed. It doesnt make sense why i would have to use this code just to update a number on a regular basis.

    So my question is: I have to do this to a whole sheet, Right now I have that code for each cell. I need a sum(g1:g27) or something similiar to simplify this and make it a whole hell of a lot easier to edit. ANY HELP WOULD BE AWESOME. Thanks in advance


    Chris
    Last edited by justchris; 02-10-2005 at 04:13 AM.

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Use the following code instead:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 7 Then
    Cells(Target.Row, 5) = Cells(Target.Row, 5) + Cells(Target.Row, 7)
    End If
    End Sub

    This code has to be entered in the module of the sheet in question. This can be done by right-clicking on the sheet tab name, and then selecting view code.


    - Mangesh

  3. #3
    Registered User
    Join Date
    04-29-2004
    Posts
    92
    Well, I see what you did there... A problem with that is I need it to stop half way down the page. Example would be g6:g20. I also like the other codes ability to be used with a button instead of on change.

    And if you have any info on where I can find some more info on this, or even help me describe what it is im trying to do so I can search for it that would be great too. That is probably my biggest problem... I dont know what to call what im trying to do.

    And Thanks Mangesh
    This project im working on might get me a nice raise(I'm up for review next week so I'll let you know )


    And thanks in advance for anyone elses help
    Chris

  4. #4
    Registered User
    Join Date
    04-29-2004
    Posts
    92
    Anyone else have any suggestions by chance?

  5. #5
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Hi Justchris,

    sorry, had not seen your reply to your second post.

    For it to work for g6:g20, modify my code above to something likethis:

    Please Login or Register  to view this content.
    And If you want it to work for a button, then use something like this:
    Assign the following code to the button. I am assuming that you will use a button from the control toolbox

    Please Login or Register  to view this content.

    - Mangesh

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1