Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default copying same data to several Workbooks

I have a form that i fill out and puts calculated data into a range of cells
K1:K12
I Need to select that range and paste it at the end of another workbook.

How do i find the last column in the
The code i have Looks at the Do loop and just goes straight to End


Sub PasteintoWeek52()

Workbooks("On Time Week 52 WIP.xls").Sheets("Weekly Performance").Activate
Dim rw As Long
rw = 10

Do Until ActiveSheet.Cells(rw, 1) = ""

Workbooks("Enter Data Sheet").Sheets("Sheet1").Activate
Range(Cells(1, 11), Cells(12, 11)).Select
Application.CutCopyMode = False
Selection.Copy

Workbooks("On Time Week 52 WIP.xls").Sheets("Weekly Performance").Activate
Range(Cells(1, rw)).Select
Selection.Paste

rw = rw + 1
Loop

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default copying same data to several Workbooks

I thought I had responded to this before, but I must have clicked the wrong
button. Anyhow, here is some code that might help you to find the place you
want to paste your data to. It locates the last cell in the used range, then
displays that in a message box for the last column and last row in the range.
It then uses that data to display the next blank cell in the next column and
another message box displays the next blank cell in the next row.

Sub lstCel()
lr = Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCel l).Row
lc = Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCel l).Column
MsgBox "Last Row is " & lr & CrLf & ", Last Col is " & lc
MsgBox "Next empty cell in Columns is Cells(" & lr & ", " & lc + 1 & ")"
MsgBox "Next empty cell in Rows is Cells(" & lr + 1 & ", " & lc & ")"
End Sub


"Miranda" wrote:

I have a form that i fill out and puts calculated data into a range of cells
K1:K12
I Need to select that range and paste it at the end of another workbook.

How do i find the last column in the
The code i have Looks at the Do loop and just goes straight to End


Sub PasteintoWeek52()

Workbooks("On Time Week 52 WIP.xls").Sheets("Weekly Performance").Activate
Dim rw As Long
rw = 10

Do Until ActiveSheet.Cells(rw, 1) = ""

Workbooks("Enter Data Sheet").Sheets("Sheet1").Activate
Range(Cells(1, 11), Cells(12, 11)).Select
Application.CutCopyMode = False
Selection.Copy

Workbooks("On Time Week 52 WIP.xls").Sheets("Weekly Performance").Activate
Range(Cells(1, rw)).Select
Selection.Paste

rw = rw + 1
Loop

End Sub

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
Copying data between Workbooks STEVEB Excel Programming 0 November 16th 05 07:06 PM
Copying data between workbooks? One Desperate Employee! Excel Discussion (Misc queries) 5 September 24th 05 09:41 AM
copying workbooks with charts and changing data uriel78 Charts and Charting in Excel 1 March 11th 05 02:00 AM
Help with Macro (copying data from multiple workbooks) Tim Harding Excel Discussion (Misc queries) 1 February 5th 05 10:37 PM
Copying Data from closed workbooks Kevin G Excel Programming 4 July 31st 03 03:46 PM


All times are GMT +1. The time now is 07:47 PM.

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"