+ Reply to Thread
Results 1 to 4 of 4

VBA Help

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Help

    I am writing a VBA program and need some help. I have an excel database that I sometimes nee to change the gross weight on. how ever I need to run it thrugh some math first. So I know the formula (Current gross weight per item on list/Old total gross weight * new total gross weight. my problem is is that I cant use cell numbers because the list of items always changes. And I need the new gross weight to display on other worksheets as well. I not sure how to make the program hold on to the old gross weight when the user is prompted to enter in the new gross weight.

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: VBA Help

    Sounds like you need a variable.

    Please Login or Register  to view this content.
    this is just an example. a variable is useful for storing information from either a cell or a result of another function within your code. use integer for small numbers, long for big numbers, string for text, and range for cell references. (to apply a value to those use 'set Range1 = range("a1")')

    You should always declare your variables at either the top of the sub for a local variable (it only works within the sub) or at the top of your module (this will work between all subs in a module)

  3. #3
    Registered User
    Join Date
    08-01-2012
    Location
    ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA Help

    Thank You. Do you think that this should be a function?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VBA Help

    Hello mcdaniel2004, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


+ 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