Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: macro to adjust for varying rows of data

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    have a bunch of spreadsheets that are of varying rows of data. I want to record a mraco that will number the row numbers
    and provide some formating in certain cells and column-total certain columns. The data is all in the same location column-wise,
    only the number of rows differs. When I record the macro, it specifies that bottom of the columns (ie; Range "A32"). The
    next spreadsheet may have 50 rows but the macro does everything as if there are 32 rows of data. How can I tell the macro
    to adjust for more rows of information.
    Thanks in advance.

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can put it in a for loop saying that something like:
    dim StartRow as integer
    dim EndRow as long
    dim i as long
    EndRow=ActiveSheet.UsedRange.Rows.Count
    For i= StartRow to EndRow
    'Insert your code here
    Next i

    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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