Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
theguz
 
Posts: n/a
Default 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


--
theguz
------------------------------------------------------------------------
theguz's Profile: http://www.excelforum.com/member.php...o&userid=24918
View this thread: http://www.excelforum.com/showthread...hreadid=392977

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup Table Dilemma Karen Excel Worksheet Functions 2 June 10th 05 08:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
In Bar Chart, can we display both figures and their respective %a. Airtel Excel Discussion (Misc queries) 3 March 9th 05 02:35 PM
Auto Skipping and protected cells Dave Peterson Excel Discussion (Misc queries) 6 January 27th 05 11:35 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"