+ Reply to Thread
Results 1 to 14 of 14

Changing Column values with VB code

Hybrid View

  1. #1
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Changing Column values with VB code

    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    I am struggling with this code, can you tie it to the code so maybe I can see the big picture...,

    I like the dynamic ranges, it makes data entry more efficient, ...trying to overcome my volitle issues, I have begun to read up on volitle isses, but I find myself a bit overwhelmed as I think everything I do is "Volatile", maybe that is my self-destructive behaviour showing itself in the form of excel...lol

    But I regress, I have faith, I will get there, with lots of help
    Providing Problems for Your Solutions
    STARS are my Punching Bag, You will be rewarded.

    In the rare event that I may help you, feel free to make me see STARS

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,239

    Re: Changing Column values with VB code

    I use the
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    Most every time I write code now.

    LastRow is a variable name I have Dim above
    Rows.Count is the maximum number of rows in this version of Excel - Way down at the bottom.
    Cells ( Row, Column) specifies a range you want to start in.
    "A" is the column you are wanting
    .End(xlUp) is the same as pressing Ctrl-UpArrow to hit the next non blank above
    .Row returns what row was found.

    So in English this says
    Go to the very last row in my worksheet at Column "A" and press Ctrl-Up and tell me what Row it stopped in. Let the variable LastRow equal to that number.

    Read http://www.mvps.org/dmcritchie/excel/cells.htm
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
    http://spreadsheetpage.com/index.php...e_size_ranges/ I like this site.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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