View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joel joel is offline
external usenet poster
 
Posts: 9,101
Default 2 questions: copying between sheets and display 0 data...

you need to do something like this

Sub copycolumns()

Sheets("sheet1").Activate
Lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
Set HeaderRange = Range(Cells(1, 1), Cells(1, Lastcol))

ColumnCount = 1
For Each cell In HeaderRange

If Not IsEmpty(cell) Then

cell.EntireColumn.Copy _
Destination:=Sheets("sheet2").Columns(ColumnCount)


ColumnCount = ColumnCount + 1
End If

Next cell

End Sub

"Grim" wrote:

Joel,

Thanks for the response.

I got the macro to copy from 1 sheet to another down, is there a macro
that will search a row and paste only headers w/data in them to
another sheet?

I tried doing this in acces... but it just laughed at me.

Thanks again.

Grim