Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

My current macro is below. It updates data for different variables for the perio

ID: 3562485 • Letter: M

Question

My current macro is below. It updates data for different variables for the period 2014 quarter 4. I want it to be able to be flexible so for example I can type in 2015 q3 and test 5 (different folder to save this data in) and it will change all areas where it says 2014 q1 and the word test. Do you suggest creating a macro to do this or a master list.. And how would I go about doing this? thanks!!
[CODE]Sub Macro3()
'
' Macro3 Macro
'
'
    ChDir _
        "X:specific folder4Q4 2014TMTTST"
    Workbooks.Open Filename:= _
        "X:specific folder4Q4 2014TMTTSTST Q4 2014.xlsm" _
        , UpdateLinks:=0
    ActiveCell.Offset(-1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "1111"
    Dim ws As Worksheet, wb As Workbook
    Set ws = ActiveSheet
    Set wb = Workbooks.Add(xlWBATWorksheet)
    ws.Range("A1:S84").Copy
    wb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteValues
    wb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteFormats
    Application.CutCopyMode = False
    ChDir "X:specific folder4Q4 2014TMT est"
    ActiveWorkbook.SaveAs Filename:= _
        "X:specificfolder4Q4 2014TMT estI1", _
        FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    ChDir _
        "X:specific folder4Q4 2014TMTTST"
    Workbooks.Open Filename:= _
        "X:speciic folder4Q4 2014TMTTSTST Q4 2014.xlsm" _
        , UpdateLinks:=0
    ActiveCell.Offset(-1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "2222"
    Set ws = ActiveSheet
    Set wb = Workbooks.Add(xlWBATWorksheet)
    ws.Range("A1:S84").Copy
    wb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteValues
    wb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteFormats
    Application.CutCopyMode = False
    ChDir "X:specific folder4Q4 2014TMT est"
    ActiveWorkbook.SaveAs Filename:= _
        "X:Fspecific folder4Q4 2014TMT est2", _
        FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub[/CODE]   

Explanation / Answer

'---------->>

Sub PassVariables()

Call Tester(myYear:=2014, _
myQuarter:="Q4", _
myFolder:="TST", _
mySaveAsFolder:="Test", _
mySaveAsName:="1111", _
mySaveAsName2:="2222")

End Sub

'---------->>

to

'---------->>
Sub PassVariables()
Call Main(myYear:=2014, _
myQuarter:="Q4", _
myFolder:="TST", _
mySaveAsFolder:="Test", _
mySaveAsName:="1111", _
mySaveAsName2:="2222")
End Sub

'---------->>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote