PC Review


Reply
Thread Tools Rate Thread

copying same data to several Workbooks

 
 
=?Utf-8?B?TWlyYW5kYQ==?=
Guest
Posts: n/a
 
      28th Feb 2007
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 With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      2nd Mar 2007
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(xlCellTypeLastCell).Row
lc = Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCell).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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying data between workbooks Karen53 Microsoft Excel Programming 4 23rd Feb 2008 01:29 AM
Copying data between Workbooks STEVEB Microsoft Excel Programming 0 16th Nov 2005 07:06 PM
Copying data between workbooks? =?Utf-8?B?T25lIERlc3BlcmF0ZSBFbXBsb3llZSE=?= Microsoft Excel Misc 5 24th Sep 2005 09:41 AM
Copying Data between Workbooks Steve Microsoft Excel Misc 1 12th Jun 2004 02:27 PM
Copying Data between Workbooks... zymbo Microsoft Excel Misc 0 16th Jan 2004 04:46 PM


Features
 

Advertising
 

Newsgroups
 


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