ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   updating a workbook based on previous values (https://www.excelbanter.com/excel-programming/330109-updating-workbook-based-previous-values.html)

simora

updating a workbook based on previous values
 
I want the user to select a workbook and have that workbook name and
values used in a macro on this weeks workbook. I'm trying to update it
weekly with new totals etc

ON the sample below, full_Of_Data.xls would be last weeks workbook,
and Blank-Today.xls would be the new blank workbook.


There's 14 worksheets and the first 2 are formatted alike, then the
next 9 are clones, so I need to be able to call the workbook name
across all these pages. The other 3 worksheets are Summary & Totals
pages.

Here's a snip of my recorded macro. It only goes to 2 pages. I
haven't gotten to the totals page yet.
Its crude, but it kinda works.


Sub WedUpdate1()

'

'
Range("A5").Select
Windows("full_Of_Data.xls").Activate
Range("A5:A82").Select
Selection.Copy
Windows("Blank-Today.xls").Activate
ActiveSheet.Paste
Windows("full_Of_Data.xls").Activate
Range("F5:H82").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Blank-Today.xls").Activate
Range("F5").Select
ActiveSheet.Paste
Windows("full_Of_Data.xls").Activate
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 9
Range("R5:R82").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Blank-Today.xls").Activate
Range("D5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks

_
:=False, Transpose:=False



Sheets("Sheet 2").Select


Range("A5").Select
Windows("full_Of_Data.xls").Activate
Sheets("Sheet 2").Select
Range("A5:A82").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Blank-Today.xls").Activate
ActiveSheet.Paste

Windows("full_Of_Data.xls").Activate
ActiveWindow.ScrollColumn = 9
Range("T5:T86").Select
ActiveWindow.SmallScroll Down:=-5
Range("T86").Select
ActiveWindow.ScrollRow = 1
Range("T5:T82").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Blank-Today.xls").Activate
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 9
Range("S5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks

_
:=False, Transpose:=False
End Sub



All times are GMT +1. The time now is 02:47 PM.

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