VBS Script assistanh to the end. Here is my code:

Ray Rz

New Member
Joined
Jun 19, 2018
Messages
29
Hi,
I have 3 macros that I need help with to make it run through:
Code:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+e
' ***** From file called May 2018 - Vendor Energy - 6.15.18 - Invoice.xlsx Tab Sheet1 to current file Tab called Sheet22 *****
'
'
Workbooks.Open Filename:= _
"C:\Users\rzepeckir\Documents\Vendor Current Month\May 2018 - Vendor Energy - 6.15.18 - Invoice.xlsx"
Selection.AutoFilter
ActiveCell.Offset(-17, -6).Range("A1:P224").Select
Selection.Copy
Windows("VBA Extractor r57with code.xlsm").Activate
'ActiveCell.Offset(-1, -1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End Sub


Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+f
'
'***** From file called Copy of Vendor Master Pole set File 06-12-18.xlsx Tab Sheet1 to current file Tab called Sheet20 *****
'
'
Workbooks.Open Filename:= _
"C:\Users\rzepeckir\Documents\Vendor Current Month\Copy of Vendor Master Pole set File 06-12-18.xlsx"
Selection.AutoFilter
ActiveCell.Offset(0, 0).Range("A2:AQ40000").Select
Selection.Copy
Windows("VBA Extractor r57with code.xlsm").Activate
'ActiveCell.Offset(-1, -1).Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End Sub




' Refresh all applicable pivot tables to setup month's data


Sub refresh()
'
' refresh Macro
' refresh data
'
' Keyboard Shortcut: Ctrl+r
MsgBox ("Update may take several minutes, Click Ok to begin")

' replace with Refresh All (had to remove the check for Enable Background refresh to make it wait)


ActiveWorkbook.RefreshAll

' Refresh all Pivot tables in all worksheets


Dim shtTemp As Worksheet
Dim pvtTable As PivotTable

For Each shtTemp In ActiveWorkbook.Worksheets
For Each pvtTable In shtTemp.PivotTables
'pvtTable.RefreshTable
Next
Next
MsgBox ("Update Complete,All data is Up-to date")
End Sub




Public Function save()


End Function

/End code
I would really like to have this run through once and need a bit of help on naming sheets in the workbook that would copy from and paste to. Any and all responses would be appreciated.
Thanks,
Ray
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top