Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Autofill Macro Needed

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

    Default

    I have several rows of text which look as follows:

    LONDON
    eng
    eng

    GLASGOW
    sco
    sco

    I need a macro to autofill from the top row and then skip the missing cell to autofill the next block. This list is about 5000 rows so the macro will have to always find the next block and fill it until there is no more data.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Graham

    Would this do the trick??

    Assuming the Column in question is Column A and data starts in A1 and the first data item is something we would want to copy down...

    Sub test()

    Lastrow = Range("A65536").End(xlUp).Row

    Range("A1").Select

    Do While ActiveCell.Row < Lastrow + 1

    If ActiveCell.Value <> "" And ActiveCell.Offset(1, 0).Value <> "" Then
    Selection.Copy
    ActiveCell.Offset(1, 0).Select
    ActiveSheet.Paste
    Else
    ActiveCell.Offset(1, 0).Select
    End If
    Loop

    End Sub

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    West Sussex
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks, that is absolutley perfect!

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
  •