+ Reply to Thread
Results 1 to 2 of 2

Looping until empty column

  1. #1
    Registered User
    Join Date
    07-05-2005
    Posts
    11

    Post Looping until empty column

    Here is my dilemma. I can do VBA in Access, but for some reason I just don't get it in excel. What I want to do is go down a column and store that info in a variable. I want this to happen untill there is no more data. Once I have that data I want to go to another page and store the data in an empty column. I want the program to auto. find the empty column. Thank You in advance.
    theguz

  2. #2
    Duke Carey
    Guest

    RE: Looping until empty column

    Are you going to copy EVERYTHING in the column, i.e., are you starting with
    row 1 and moving down until you find nothing else?

    If so, just copy the column

    Now, what's the criteria for finding an empty column? Is it the first
    column you come to, moving left to right, that has nothing in it? I'll
    assume that's so.

    This code copies column A on sheet1 to the first unused column on sheet2

    Dim src As Range
    Dim tgt As Range

    Set src = Worksheets("sheet1").Range("A:A")
    With Worksheets("sheet2")
    Set tgt = .UsedRange.Offset(0, .UsedRange.Columns.Count). _
    Resize(1, 1).EntireColumn
    End With
    src.Copy tgt


    "theguz" wrote:

    >
    > Here is my dilemma. I can do VBA in Access, but for some reason I just
    > don't get it in excel. What I want to do is go down a column and store
    > that info in a variable. I want this to happen untill there is no more
    > data. Once I have that data I want to go to another page and store the
    > data in an empty column. I want the program to auto. find the empty
    > column. Thank You in advance.
    > theguz
    >
    >
    > --
    > theguz
    > ------------------------------------------------------------------------
    > theguz's Profile: http://www.excelforum.com/member.php...o&userid=24918
    > View this thread: http://www.excelforum.com/showthread...hreadid=392977
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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