Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Donna Thompson   on Aug 09 In MS Office Category.

  
Question Answered By: Fabian Ferrrari   on Aug 09

OK. Copy/paste-special/values is probably the way to go.

There might be added complexities, e.g. if your workbook  has multiple
worksheets and/or is nicely formatted, however, the basic principle can
remain the same, and similar to doing it by hand.

The easy way to eliminate formulas and links from a worksheet manually is to
select the full extent of its cells, then copy, then paste-special/values
over the same location. This seems to work fine in all cases. And it lends
itself to being recorded as a macro.

I just popped values  in a couple of cells of an empty sheet and recorded:
ctrl-home, ctrl-shift-end, copy  (ctrl-c), paste-special/values (alt-e, s,
v). The code recorded (Excel 2003) is nice and general:

Option Explicit

Sub Macro1()
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End Sub

I.e. the macro  didn't record absolute positioning for the bottom of the
data, which makes it usable on any sheet.

If your workbook only contains a single sheet (or exactly the same sheets
every time), it is possibly easiest to create  a new empty workbook, then
copy all the sheets to it (so that you get column widths and formatting),
then do a copy/paste-special for each sheet. You should be able to record a
macro of yourself doing all of this. Then you can simply tie it to a button
or hot-key sequence for use later.

Of course, you'll probably want to tailor the code a bit once you have
recorded it, but the recording facility should get you well down the road.

Share: