|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi!
I'm new to macro coding and need some help. I have an excel sheet that has cell B3 filled with a month (i.e. December). I also have an existing macro for that sheet that, when ran, will move data from one column to another column then clearing the original column. I would also like to have the same macro recognize the month already resident in cell B3, and increment that content to the next month when the macro is ran. In other words, cell B3 contains the month "December". When I run the macro, it reads cell B3, then increments the month such that cell B3 will now read the month "January". Here is the macro code I have currently: Sub UPDATE() ' ' UPDATE Macro ' Macro created by 373 TRS ' ' Sheets("43 MXS").Select Range("D4:F41").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("C4").Select ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("F4").Select ActiveCell.FormulaR1C1 = "0" Range("F4:F41").Select Selection.ClearContents Range("F4").Select Sheets("2 AS").Select Range("D4:F41").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("C4").Select ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("F4").Select ActiveCell.FormulaR1C1 = "0" Range("F4:F41").Select Selection.ClearContents Range("F4").Select Sheets("41 AS").Select Range("D4:F41").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("C4").Select ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("F4").Select ActiveCell.FormulaR1C1 = "0" Range("F4:F41").Select Selection.ClearContents Range("F4").Select Sheets("743 MXS").Select Range("D4:F41").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("C4").Select ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("F4").Select ActiveCell.FormulaR1C1 = "0" Range("F4:F41").Select Selection.ClearContents Range("F4").Select Sheets("TDY").Select Range("D4:F41").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("C4").Select ActiveSheet.PasteSpecial Format:=7, Link:=1, DisplayAsIcon:=False, _ IconFileName:=False Range("F4").Select ActiveCell.FormulaR1C1 = "0" Range("F4:F41").Select Selection.ClearContents Range("F4").Select Sheets("898").Select Range("J9:J236").Select Application.CutCopyMode = False Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("I9:I236").Select Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _ Transpose:=False Application.CutCopyMode = False With Selection .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop .WrapText = False .Orientation = 0 .IndentLevel = 0 .ShrinkToFit = False End With Range("L9:L236").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("J9:J236").Select Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _ Transpose:=False Range("L9:L236").Select Application.CutCopyMode = False Selection.ClearContents Range("N9:N236").Select Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("M9:M236").Select Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _ Transpose:=False Range("O9:O236").Select Application.CutCopyMode = False Selection.Copy ActiveWindow.LargeScroll Down:=-3 Range("N9:N236").Select Selection.PasteSpecial Paste:=7, Operation:=xlNone, SkipBlanks:=False, _ Transpose:=False Range("O9:O236").Select Application.CutCopyMode = False Selection.ClearContents Range("P9:Q13").Select End Sub Any help will be greatly appreciated. Thanks A10 Instructor |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Excel macro and "months" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|