Results 1 to 3 of 3

Thread: VBA Excel

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I have text that will update my Excel spread sheet I never know how long the row will go because it is dependent on the date span.

    How do I get the row to get a shaded quality to basically loop until there is no date or text in the cell?

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    You can use either one of these method to grab the last row.

    Code:
      'OVERALL: Count the number of records
    
      'Method1
      Dim intLastRow as Integer
      intLastRow = ActiveCell.SpecialCells(xlLastCell).Row
      
      'Method2
      intLastRow = ActiveSheet.UsedRange.Rows.Count

    After that just put it into a loop.

    Code:
    Do
      'Your Instructions
    Loop Until activecell.row = intLastRow
    Chemically Formulated As:
    Dr. Nitro

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    thank you!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width