View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Champlin Richard Champlin is offline
external usenet poster
 
Posts: 32
Default Recording macros that involve more than 1 workbook

It seems that the macro does not recognize the alt-tab toggle to another
spreadsheet.

Sub UpdateVariances()
'
' UpdateVariances Macro
' Macro recorded 8/23/2007 by Richard Champlin
'

'
Columns("A:C").Select
Selection.Delete Shift:=xlToLeft
Columns("B:H").Select
Selection.Delete Shift:=xlToLeft
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
Columns("G:H").Select
Selection.Insert Shift:=xlToRight
Columns("K:K").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Selection.Font.Bold = True
Columns("A:A").Select
Range(Selection, Selection.End(xlToRight)).Select
Columns("A:J").Select
Columns("A:J").EntireColumn.AutoFit
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A2:J21").Select
Selection.Cut
Application.CutCopyMode = False
End Sub

--
Richard Champlin
Administrative Program Assistant II
Children''''''''s Hospital & Regional Medical Center, Seattle


"Michael" wrote:

The VBA code has change but not significantly, post your code and I maybe
able to provide a better answer.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Richard Champlin" wrote:

Last night, my computer was upgraded to Windows XP. I found that macros I
had recorded were no longer visible. The one I used most often was rather
simple, so I just re-recorded it...it involves copying some data from a CSV
file into an Excel spreadsheet. Before the upgrade, it worked perfectly.
Now, it seems to stop functioning when I toggle between the affected files.
Any ideas?
--
Richard Champlin
Administrative Program Assistant II
Children''''s Hospital