Results 1 to 8 of 8

Variable holding a value instead of recalculating based on parameters.

Threaded View

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Variable holding a value instead of recalculating based on parameters.

    Ok, I am using a simple line of code to grab a value for the last row with data on a sheet.
    Dim LastRow As Integer
    LastRow = ActiveSheet.UsedRange.Rows.Count
    At first it appeared to work as intended, but it is holding a value and not recalculating when it is called again.
    example: I push the button 5 times. It populates the information in the correct fileds. If I clear the fields and push the button again, it populates the information in the 6th spot and does nothing with the now blank 5 fields.
    I may be wrong about this but I thought that even though I assigned it as a variable, when I called it a second time, it would recalculate based on the parameters assigned to it.
    The plus side is that it will recognize that there is data in a field and skip it without overwriting it. But I need it to fill in blank cells if I delete them. I am going to attach my sheet so you can see what i am doing.

    Cheers!
    Attached Files Attached Files

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