Excel Formatting

spinkung

Registered User.
Local time
Today, 14:56
Joined
Dec 4, 2006
Messages
267
Hi All,

I'm doing some excel formatting from access. I'm trying to cut an entire row and paste it on another sheet.

i'm trying...
Code:
xlSht_invoice.Range("A" & rowRef).EntireRow.CUT
[COLOR="Red"]xlSht_service.Range("A" & iLast_service).PasteSpecial xlPasteValues[/COLOR]
...but i keep getting a: pastespecial method of range class failed

anyone???

Thanks,
Spin
 
Perhaps

xlSht_service.Range("A" & iLast_service).EntireRow.PasteSpecial xlPasteValues

(untested)
 
thanks, but unfortunately gives the same error

Code:
xlSht_service.Range("A" & iLast_service).EntireRow.PasteSpecial xlPasteValues
 
SOLVED IT WITH.....

Code:
xlSht_invoice.Range("A" & rowRef).COPY
xlSht_service.Range("A" & iLast_service).PasteSpecial PASTE:=xlPasteValues

Thanks.
 
What it appears is that it will work with

.Copy

but not with

.Cut

so you can copy it first (using the same code I gave but changing your original .Cut to .Copy) and then clear the cells from the first row. So this:


Code:
xlSht_invoice.Range("A" & rowRef).EntireRow.[COLOR="Red"]Copy[/COLOR]
xlSht_service.Range("A" & iLast_service)[COLOR="red"].EntireRow.[/COLOR]PasteSpecial xlPasteValues
[COLOR="red"]xlSht_invoice.Range("A" & rowRef).EntireRow.CLEAR[/COLOR]
 
haha, thanks bob.

thats pretty strange/annoying that you can't use the cut option.
 
Well, you can use the Paste option with the Cut but not the PasteSpecial option.
 

Users who are viewing this thread

Back
Top Bottom