View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
RobinTaylor RobinTaylor is offline
external usenet poster
 
Posts: 4
Default Recorded macro won't run

Well, gee whiz! Guess they though we wouldn't need that one anymore!

Thanks for all your help. I appreciate it!

"Jim Thomlinson" wrote:

Welcome to a bug in Excel 2000. There is no xlColumnWidths. Try this code...

Check out this link...
http://support.microsoft.com/default...b;en-us;231090

Here is some code that should work for you...

ActiveCell.Range("A1:D28").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues
Selection.PasteSpecial Paste:=xlFormats
Selection.PasteSpecial Paste:=8

HTH

"RobinTaylor" wrote:

Here is the macro:

ActiveCell.Range("A1:D28").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

"Don Guillett" wrote:

Post the rest of your macro. Somehow you may have selected something that
took your copy away.

--
Don Guillett
SalesAid Software

"RobinTaylor" wrote in message
...
I recorded a simple macro to copy data from a worksheet and paste it into
a
new blank worksheet. In the recorded code was the line:

Application.Run Range("ScOnWindow")

When I ran the code, I got an error on this line. Normally I remove these
"sconwindow" lines from the code anyway, but it concerns me that something
I
just recorded will not run. Am I missing a reference library or
something?
It will also crash on the following recorded line:

Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Any help would be appreciated! Thanks!