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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,213,497
Messages
6,113,999
Members
448,541
Latest member
iparraguirre89

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