+ Reply to Thread
Results 1 to 13 of 13

static Variable Noobie help.

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    static Variable Noobie help.

    Ok, below is the code I have thus far. As of right now when the message box pops up it says 1 in the area I type. If I click ok, the next time it pops up I need it to go up 1. For example. If I type in 23, the next time the box comes up I need it to be 24. Any help would be great

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: static Variable Noobie help.

    Try something like this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: static Variable Noobie help.

    To my understanding, you filter on numbers in column F (6) in Sheet9.
    The filtered data is then copied into Sheet10.
    So you can retrieve the last filtered value and add 1 to it.
    Is this thinking right?
    If so, try this on a copy of your workbook.
    BTW, minimize or get rid of the Activating and Selecting. It slows your code down
    Use With...End With instead.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    Jolivanes: It errors below. yes using column F in sheet 9 to decide which rows to copy to sheet 10.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    Alpha frog: Works perfectly!!!!!!!!!! Ty.

  6. #6
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    Alpha frog: The data it is pulling from sheet 9 Collums C and D is being put into Sheet 10 as Text. How can I change that.

    I have a
    Please Login or Register  to view this content.
    on sheet2 pulling this info from sheet 10.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: static Variable Noobie help.

    Quote Originally Posted by dohara View Post
    Alpha frog: The data it is pulling from sheet 9 Collums C and D is being put into Sheet 10 as Text. How can I change that.

    I have a
    Please Login or Register  to view this content.
    on sheet2 pulling this info from sheet 10.
    If the values on sheet 9 are are numeric-text, then text is what gets pasted. If they are numbers, then numbers are pasted.

    So if the columns C:D on sheet 9 have cell formatting as text, or if they have formulas that return text-numbers (quotes around the number in the formula), then that's is the cause of the problem.

    If you imported the values on sheet 9 from a csv or text file, you may have to convert the numeric-text to numbers. Put a 1 in an empty cell. Copy it. Then Pastespecial-Multiply over columns C:D
    Last edited by AlphaFrog; 04-29-2014 at 03:18 PM.

  8. #8
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    The formula is the one you pasted above. I am not seeing any issues looking at it. They are numbers in sheet 9.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: static Variable Noobie help.

    Quote Originally Posted by dohara View Post
    The formula is the one you pasted above. I am not seeing any issues looking at it.
    I didn't give you a formula. I don't know what that means.

    They are numbers in sheet 9.
    Numeric-text "looks" like numbers. How do you know? I'm not trying to be difficult, but I cannot see your sheet and I don't know you skill level.

    Can you post an example workbook that illustrates the problem?

  10. #10
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    This is what pulls from 9 to 10 (What you pasted earlier)

    Please Login or Register  to view this content.
    My skill level is low.

  11. #11
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    Ok I think I figured it out. Sheet8 pushes to 9 using
    Please Login or Register  to view this content.
    I am assuming this is my issue. I use the ""so it does not return a zero. Is there a way to make this numeric not text, without having a zero?

    It is a massive workbook, to large to upload. If this is not my issue, I will create a sample.

  12. #12
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: static Variable Noobie help.

    Quote Originally Posted by dohara View Post
    Ok I think I figured it out. Sheet8 pushes to 9 using
    Please Login or Register  to view this content.
    I am assuming this is my issue. I use the ""so it does not return a zero. Is there a way to make this numeric not text, without having a zero?

    It is a massive workbook, to large to upload. If this is not my issue, I will create a sample.
    That's probably it. That formula returns numeric-text.

    Try this...
    =IF(Sheet8!C2="","",Sheet8!C2)

  13. #13
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: static Variable Noobie help.

    That worked! You Rock!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Static Variable.
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2012, 03:04 AM
  2. static global variable?
    By fern in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2007, 02:58 AM
  3. [SOLVED] Static variable
    By cottage6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2005, 03:05 PM
  4. NOT static variable problem
    By Neal Zimm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2005, 12:06 PM
  5. static to variable
    By zigtag3d in forum Excel General
    Replies: 1
    Last Post: 03-13-2005, 05:19 PM

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