Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Macro - Copy row and paste on all tabs

I'm looking for an easy macro that copies row 4 from sheet1 and pastes data
(column headers) in Row 1 on all the other tabs. The number of tabs
fluctuates.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Macro - Copy row and paste on all tabs

Hi

Dim i As Integer
For i = 2 To Sheets.Count
Sheets("sheet1").Rows(4).Copy Sheets(i).Range("A1")
Next


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"masterbaker" wrote:

I'm looking for an easy macro that copies row 4 from sheet1 and pastes data
(column headers) in Row 1 on all the other tabs. The number of tabs
fluctuates.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro - Copy row and paste on all tabs

try
Sub copytoall()
For Each ws In Worksheets
Sheets("sheet1").Range("a4:x4").Copy ws.Range("a4")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"masterbaker" wrote in message
...
I'm looking for an easy macro that copies row 4 from sheet1 and pastes
data
(column headers) in Row 1 on all the other tabs. The number of tabs
fluctuates.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Macro - Copy row and paste on all tabs

Thanks Don, close but not exactly what I'm looking for. I have attemted to
change it around a bit. Here's what I have:

For Each ws In Worksheets
Sheets("sheet1").Range("A1").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Copy ws.Range("A1")
Next


I am having an issue with my code. What I'm trying to do is copy the entire
first row below row A in Sheet1 that has data (my column titles) and paste
these titles on all other tabs in the workbook. Any help would be greatly
appreciated!

Thanks!

"Don Guillett" wrote:

try
Sub copytoall()
For Each ws In Worksheets
Sheets("sheet1").Range("a4:x4").Copy ws.Range("a4")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"masterbaker" wrote in message
...
I'm looking for an easy macro that copies row 4 from sheet1 and pastes
data
(column headers) in Row 1 on all the other tabs. The number of tabs
fluctuates.



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
Combining all tabs into 1 master w/o copy&paste Webs Excel Worksheet Functions 1 March 6th 09 12:29 AM
Copy & Paste Across Sheet Tabs in a Range of Cells Karen Excel Discussion (Misc queries) 4 November 11th 08 09:25 PM
Can you copy multiple tabs from formulas to values w/o paste spec? Brent Excel Worksheet Functions 2 October 27th 05 12:47 AM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 08:32 AM.

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"