View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
mike mike is offline
external usenet poster
 
Posts: 216
Default Find Empty Column and paste cell values

Tom
Thanks for responding but I am still having trouble with the program
I will rewrite the question and maybe you can see what I am not understanding.

I want to write a Macro that finds the first empy column in Range

(A1:IU),cells A1:F1=" ", in worksheet2** the whole column does not have to be empty just the
first 6 rows.
then paste the current values in Worksheet1,cells (A1:F1) to Worksheet2,

(a1:f1). ( having trouble copying the cells in worksheet 1(A1:f1) to the empty cells
(a1:f1) IN worksheet 2
I am using worksheet 2 as a database worksheet, so it is important to save the data in worsheet 1.

Also, how do the below statements fit into the subrouutine
worksheets("Sheet2").Range("A1:F1").Value = _
worksheets("Sheet1").Range("A1:F1").Value

I hope you can figure out what I need to do.

thanks for your help
mike
----- Tom Ogilvy wrote: -----

worksheets("Sheet2").Range("A1:F1").Value = _
worksheets("Sheet1").Range("A1:F1").Value


Dim rng as Range
for each cell in Range("A1:IV1")
if application.countA(cell.EntireColumn) = 0 then
set rng = cell.Entirecolumn
Exit for
End if
Next
if not rng is nothing then rng.Select

--
Regards,
Tom Ogilvy


Mike wrote in message
...
I have a question that I hope someone can help.
I want to write a Macro that finds the first empy column in Range

(A1:IU),cells A1:F1=" ", in worksheet2
then paste the current values in Worksheet1,cells (A1:F1) to Worksheet2,

(a1:f1).
thanks for the help
mike