Excel VBA script to create new sheet and edit formulas accordingly -


It may look trivial but I have no need to do for a few weeks.

This is a daily script that makes a template for me, so it creates the same table for the month of each month. However I need to update the formulas in this template.

I have 2 documents, call them source and RESULTS . There are 28 worksheets for each day of February source . There is some data in A1

However in each letter (each day), SOURCE because it only creates a copy of the table with the sources, so I have 28 worksheets With the result where each refers to the day's formula 1.Feb sheet of SOURCE .

I want to refer to each worksheet related to the relevant day 1.Feb refers to the 1.Feb of the worksheet source of the results 2.Feb refers to SEEEE 2.Feb .. Is .. and so on.

Can anyone help?

Here's the code

  private sub workbook open () int answer = MsgBox ( "Tento program ti pripravi prazdnu predlohu na XXX." As North Dim & amp; Chr (13) & "Pre-pokracovanie stlac fine, pre-ukoncenie programu alebo editaciu" & Chr (13) & "predlohy stlac cancellation", vbOKCancel, "Welcome") Episode select episode vbOK Then Answer the Answer vbCancel then Answer = VBOK then finish the test call = vbCancel again MsgBox ("Processor ukonceny uzivatelom") Goto line 2 End if the end line 2 Select! Test () 'Open and macro work was chosen dim' Long Dim Dekount As Integer Dim Din_lup As Integer Dim Njadikastu string as najdi_cestu = ThisWorkbook.Path and amp; To get the number of months the user wants to work with "\" Application.ScreenUpdating = true 'Input Box Line 1: selected_month = 13 while (selected_month> LT; 1) or (selected_month> 12) selected_month = Val (InputBox ("Zadaj poradove cislo Mesiaca")) If selected, exit from month = 0, then the loop above the sub wand 'script will loop up to 0 or 1 - 12 "Select Case tells how many months in the selected month Days are selected Episode 4, Episode 4, 6, 9, 11 Day_count = 30 cases 1, 3, 5, 7, 8, 10, 12 days_ count = 31 case other days_y Select the suffix = 28 end 'day_loop = 1 phase -1 sheets for day_count ("template"). Copy before: = Sheets (2) ActiveSheetName = day_loop & amp; "." & Amp; . Left (MONTHNAME (selected_month), 3) Next day_loop Application.DisplayAlerts = False Sheets ( "Blueprint") Delete Auto Pathfinder ActiveWorkbook.SaveAs Filename: = najdi_cestu & amp; "Zemanov Priybih výroby" & amp; Format (MONTHNAME (selected_month)) & amp; ".xlsx", fileformat: = _ xlOpenXMLWorkbook MsgBox ( "Tvoja predloha na mesiac" & amp; format (MONTHNAME (selected_month)) & amp; "said ulozena work:" & amp; najdi_cestu) 'manualny save' ActiveWorkbook.SaveAs File Name: = "C: \ Users \ pz595v \ Desktop \ Final Virza \" & amp; Format (MonthName (selected_month)) & amp; ".xlsx", FileFormat: = _ 'xlOpenXMLWorkbook Line3: End sub  

No one Answer but this way; Select a case a that resembles , when you type:

  Select Case Odogovd episode vbOK if Oddowjd = vbOK then call Test and Case vbCancel answer = vbCancel then MsgBox ( "processor ukonceny uzivatelom") goto line 2 end select end If  

you just ought to write it:

  Select episode north episode vbOK 'This line checks that answers = vbOK call test case vbCancel' This line checks Select the person answer = vbCancel MsgBox ( "processor ukonceny uzivatelom") goto line 2 End  

Since the Odpijd Bet select case before < / Code>.


Comments