Results 1 to 7 of 7

Macro Help Required - Run script until no more data in column. Possible loop needed?

Threaded View

  1. #1
    Registered User
    Join Date
    02-28-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    49

    Question Macro Help Required - Run script until no more data in column. Possible loop needed?

    Hi,

    I have a simple Button that when pressed will run the following command:

    Sub Button2_Click()
    '
    ' Button2_Click Macro
    '
    
    '
        Range("B2").Select
        ActiveCell.FormulaR1C1 = "=""'""&RC[-1]&""',"""
        Range("B2").Select
        Selection.AutoFill Destination:=Range("B2:B53"), Type:=xlFillDefault
        Range("B2:B53").Select
        ActiveWindow.SmallScroll Down:=-30
    End Sub
    The problem I am facing is, the list is column A will vary in length ever day, therfore I do not want to have to edit my code daily. Can someone help me re-code this so it stops when it gets to the last cell that contains data in column A. I know I can simple change Range("B:B") but I am then left with date that needs to be deleted.
    Any help would be much appreciated.

    Dave
    Last edited by djm601; 02-28-2012 at 07:59 AM. Reason: my question was answered

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