My code was created directly from the macro recorder. I went back and cleaned a few things up, but now it keeps getting stuck on the column width paste. I created a bunch of templates on worksheet "WATERAB" and I'm trying to copy each template to a new sheet.
Paste:=xlColumnWidths: PasteSpecial method of Range class failed
-
-
-
Re: column width paste not working
Not sure exactly what you are trying to do, but for example, this copies a range and then pastes the column widths into another range ("A1").
CodeSheets("Sheet2").Range("D4:L26").Copy Sheets("Sheet1").Range("A1").PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False
You need to select a CELL as a range before you use the PasteSpecial, and not an entire worksheet, because the "paste special" wont really know where to start pasting.... if you know what I mean....
Ger
-
Re: column width paste not working
ok, I tried adding a range and it still is giving me the error:
"PasteSpecial method of Range class failed"Here is the new code:
-
Re: column width paste not working
Which PasteSpecial is failing....? Or why do you have two....?
I just tried the exact snip of code as you have it there and it works fine....
The only thing I canged was
Sheets("WATERAB").Range("DE10:DO21").Copy
to
Sheets("Sheets2").Range("DE10:DO21").Copy
Ger
-
Re: column width paste not working
Hi kruegs35,
PMFJIQuotekeeps getting stuck on the column width paste
Have a look at this message Msg and especially
Quote.... MS-KB article 231090 addresses this error ...
Stefan -
-
Re: column width paste not working
Stefan, that solved the problem, thanks.
Ger, thanks for your time, I appreciate it.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!