How do I allow a macro to change tabs, at the moment I could record the macro for a certain tab but it will only run on the one I triggered it from.
How do I allow a macro to change tabs, at the moment I could record the macro for a certain tab but it will only run on the one I triggered it from.
If you post a macro that runs on a given sheet, I or someone else will show you how to change it to operate on a different sheet.
Entia non sunt multiplicanda sine necessitate
Here you go:
![]()
Sub Macro5() ' ' Macro5 Macro ' ' Range("E6").Select ActiveCell.FormulaR1C1 = _ "=(R[5]C*'Database 3'!R[93]C[24])-R[5]C/3*'Database 3'!R[93]C[26]" Range("E7").Select ActiveCell.FormulaR1C1 = _ "=(R[3]C*'Database 3'!R[92]C[24])-R[3]C/3*'Database 3'!R[92]C[26]" Range("E17:F18").Select ActiveCell.FormulaR1C1 = "24 Tanned Hides, Needle, Thread and 2 space fillers" With ActiveCell.Characters(Start:=1, Length:=51).Font .Name = "Calibri" .FontStyle = "Regular" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With Range("C7:C8").Select ActiveCell.FormulaR1C1 = "Tanned D'hide's to bodys (Green)" With ActiveCell.Characters(Start:=1, Length:=32).Font .Name = "Calibri" .FontStyle = "Regular" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With Range("C13").Select ActiveCell.FormulaR1C1 = "=General!R[33]C[2]" Range("C14").Select ActiveWindow.SmallScroll Down:=28 Range("A32").Select ActiveCell.FormulaR1C1 = "62" Range("A33").Select ActiveWindow.SmallScroll Down:=-56 End Sub
Here you go:
![]()
Sub Macro5() With Worksheets("someSheet") ' change as appropriate .Range("E6").FormulaR1C1 = "=(R[5]C*'Database 3'!R[93]C[24])-R[5]C/3*'Database 3'!R[93]C[26]" .Range("E7").FormulaR1C1 = "=(R[3]C*'Database 3'!R[92]C[24])-R[3]C/3*'Database 3'!R[92]C[26]" .Range("E17:F18").Value = "24 Tanned Hides, Needle, Thread and 2 space fillers" With .Range("E17").Font .Name = "Calibri" .FontStyle = "Regular" .Size = 11 .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With .Range("C7:C8").Value = "Tanned D'hide's to bodys (Green)" With .Range("C7").Font .Name = "Calibri" .FontStyle = "Regular" .Size = 11 .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 .ThemeFont = xlThemeFontMinor End With .Range("C13").FormulaR1C1 = "=General!R[33]C[2]" .Range("A32").Value = "62" End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks