ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Recording macros that involve more than 1 workbook (https://www.excelbanter.com/excel-worksheet-functions/155566-recording-macros-involve-more-than-1-workbook.html)

Richard Champlin

Recording macros that involve more than 1 workbook
 
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

Michael

Recording macros that involve more than 1 workbook
 
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


Richard Champlin

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



All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com