PC Review


Reply
 
 
Suzanne
Guest
Posts: n/a
 
      7th Feb 2008
I'm still not getting consistent paste results with code I've been trying to
work out, so I was looking to tighten up the copy formula, but am getting an
error message.

Dim r As Range, r1 As Range
With Worksheets("IHSF DATA ENTRY") ' the source, columns a-j
Set r = .Cells(Rows.Count, 1).End(xlUp).Row
End With
With Worksheets("MERGE DATA IHSF") ' the destination; columns d-m
Set r1 = .Range("D2").CurrentRegion
r1.Offset(1, 0).Copy r(2)
End With

Thanks... suzleigh
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      7th Feb 2008

Line... "Set r = .Cells(Rows.Count, 1).End(xlUp).Row"

Should be... Set r = .Cells(.Rows.Count, 1).End(xlUp)
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Suzanne"
wrote in message
I'm still not getting consistent paste results with code I've been trying to
work out, so I was looking to tighten up the copy formula, but am getting an
error message.

Dim r As Range, r1 As Range
With Worksheets("IHSF DATA ENTRY") ' the source, columns a-j
Set r = .Cells(Rows.Count, 1).End(xlUp).Row
End With
With Worksheets("MERGE DATA IHSF") ' the destination; columns d-m
Set r1 = .Range("D2").CurrentRegion
r1.Offset(1, 0).Copy r(2)
End With
Thanks... suzleigh
 
Reply With Quote
 
Suzanne
Guest
Posts: n/a
 
      7th Feb 2008
No... still doesn't work.


"Jim Cone" wrote:

>
> Line... "Set r = .Cells(Rows.Count, 1).End(xlUp).Row"
>
> Should be... Set r = .Cells(.Rows.Count, 1).End(xlUp)
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
>
>
> "Suzanne"
> wrote in message
> I'm still not getting consistent paste results with code I've been trying to
> work out, so I was looking to tighten up the copy formula, but am getting an
> error message.
>
> Dim r As Range, r1 As Range
> With Worksheets("IHSF DATA ENTRY") ' the source, columns a-j
> Set r = .Cells(Rows.Count, 1).End(xlUp).Row
> End With
> With Worksheets("MERGE DATA IHSF") ' the destination; columns d-m
> Set r1 = .Range("D2").CurrentRegion
> r1.Offset(1, 0).Copy r(2)
> End With
> Thanks... suzleigh
>

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      7th Feb 2008

It works for me.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Suzanne"
wrote in message
No... still doesn't work.


 
Reply With Quote
 
Suzanne
Guest
Posts: n/a
 
      8th Feb 2008
The formula copied the first row of MERGE DATA IHSF (nothing else)

"Jim Cone" wrote:

>
> It works for me.
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
>
>
> "Suzanne"
> wrote in message
> No... still doesn't work.
>
>
>

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      8th Feb 2008

Add the two Msgbox lines to the code to get a reading on what is going on...
Also, technically there are no "formulas" in the posted code.
'--
Dim r As Range, r1 As Range
With Worksheets("IHSF DATA ENTRY") ' the source, columns a-j
Set r = .Cells(.Rows.Count, 1).End(xlUp)
End With
With Worksheets("MERGE DATA IHSF") ' the destination; columns d-m
Set r1 = .Range("D2").CurrentRegion

MsgBox "D2 Current region is :" & r1.Address & vbCr & _
"The offset area :" & r1.Offset(1, 0).Address & " will be copied. "

r1.Offset(1, 0).Copy r(2)
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Suzanne"
wrote in message
The formula copied the first row of MERGE DATA IHSF (nothing else)

 
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
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Internet Explorer 0 22nd Apr 2011 10:08 AM
Whe I paste a copy, get error and copy is in grey? =?Utf-8?B?R2xhc3NtYXJibGU=?= Microsoft Access Forms 1 15th Aug 2006 08:51 PM
Copy Error: Setup cannot copy the file upnpui.dll Synapse Syndrome Windows XP General 3 4th Jul 2005 03:19 PM
cannot copy folder to new drive: error... cannot copy file Chris Windows XP General 3 14th Mar 2004 09:44 PM


Features
 

Advertising
 

Newsgroups
 


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