A
akbnsl
I am having trouble referencing a cell using two variables (in this
case the variables are tbindex1 and chindex1). II have included the
code below. Anyone know a solution?
Sub PrintMacro()
Dim wks As Worksheet
Dim N As Long
Dim TableRange1 As String
Dim TableRange2 As String
Dim TableRange3 As String
Dim TableRange4 As String
Dim TableRange5 As String
Dim TableRange6 As String
Dim ChartRange1 As String
Dim ChartRange2 As String
Dim ChartRange3 As String
Dim ChartRange4 As String
'Define ranges
mdindex1 = Sheets("Cover").range("E13").Value
modelrange = "B5:" + mdindex1 + "$36,B38:" + mdindex1 + "83"
tbindex1 = Sheets("Cover").range("E14").Value
chindex1 = Sheets("Cover").range("D18").Value
chindex2 = Sheets("Cover").range("D19").Value
chindex3 = Sheets("Cover").range("D20").Value
chindex4 = Sheets("Cover").range("D21").Value
TableRange1 = "$A$4:$" + tbindex1 + "$45"
TableRange2 = "$A$47:$" + tbindex1 + "$88"
TableRange3 = "$A$91:$" + tbindex1 + "$132"
TableRange4 = "$A$135:$" + tbindex1 + "$176"
TableRange5 = "$A$179:$" + tbindex1 + "$220"
TableRange6 = "$A$223:$" + tbindex1 + "$264"
ChartRange1 = "$c$4:$" + tbindex1 + "$" + chindex1
ChartRange2 = "$c$47:$" + tbindex1 + "$" chindex2
ChartRange3 = "$c$91:$" + tbindex1 + "$" chindex3
ChartRange4 = "$c$135:$" + tbindex1 + "$" chindex4
case the variables are tbindex1 and chindex1). II have included the
code below. Anyone know a solution?
Sub PrintMacro()
Dim wks As Worksheet
Dim N As Long
Dim TableRange1 As String
Dim TableRange2 As String
Dim TableRange3 As String
Dim TableRange4 As String
Dim TableRange5 As String
Dim TableRange6 As String
Dim ChartRange1 As String
Dim ChartRange2 As String
Dim ChartRange3 As String
Dim ChartRange4 As String
'Define ranges
mdindex1 = Sheets("Cover").range("E13").Value
modelrange = "B5:" + mdindex1 + "$36,B38:" + mdindex1 + "83"
tbindex1 = Sheets("Cover").range("E14").Value
chindex1 = Sheets("Cover").range("D18").Value
chindex2 = Sheets("Cover").range("D19").Value
chindex3 = Sheets("Cover").range("D20").Value
chindex4 = Sheets("Cover").range("D21").Value
TableRange1 = "$A$4:$" + tbindex1 + "$45"
TableRange2 = "$A$47:$" + tbindex1 + "$88"
TableRange3 = "$A$91:$" + tbindex1 + "$132"
TableRange4 = "$A$135:$" + tbindex1 + "$176"
TableRange5 = "$A$179:$" + tbindex1 + "$220"
TableRange6 = "$A$223:$" + tbindex1 + "$264"
ChartRange1 = "$c$4:$" + tbindex1 + "$" + chindex1
ChartRange2 = "$c$47:$" + tbindex1 + "$" chindex2
ChartRange3 = "$c$91:$" + tbindex1 + "$" chindex3
ChartRange4 = "$c$135:$" + tbindex1 + "$" chindex4