row headings

verluc

Well-known Member
Joined
Mar 1, 2002
Messages
1,451
I have a sheet1 where I run a macro that makes a filter and than copy the result of this filter to sheet2.
I like to add also the row headings from sheet1 to sheet2.
How can I do that within the same macro?
Many thanks.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi
Assuming that your headers are in row 1.

Sheets("Sheet1").Rows("1:1").Copy Destination:= _
Sheets("Sheet2").Rows("1:1")

Tom
 
Upvote 0
On 2002-04-23 01:21, TsTom wrote:
Hi
Assuming that your headers are in row 1.

Sheets("Sheet1").Rows("1:1").Copy Destination:= _
Sheets("Sheet2").Rows("1:1")

Tom
Thanks Tom,but what if sheet2 is in anoter workbook?Is this possible?
Thanks in advance
 
Upvote 0
Hi verluc. Pls try this.
<pre>
Sheets("Sheet1").Rows(1).Copy _
Workbooks("NameOfAnotherBook.xls").Sheets("Sheet2").Rows(1)
</pre>

Regards,
Colo
 
Upvote 0
On 2002-04-23 01:11, verluc wrote:
I have a sheet1 where I run a macro that makes a filter and than copy the result of this filter to sheet2.
I like to add also the row headings from sheet1 to sheet2.
How can I do that within the same macro?
Many thanks.
In my question I like to add the row headings but is this also possible to add several cells in place of the hole row?
Many thanks
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top