Hello, i am trying to figure out why my below code is not taking the offset into effect, it is just
If Source.Worksheets("Sch Q").Range("N17").Value = "- Select -" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = none
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "GEN" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "General"
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "PAS" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "Passive"
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "901j" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "Section 901(j)"
End If
the offset value comes from this code
Dim num_ent As Variant
ent_num = ThisWorkbook.Worksheets("File Paths").Range("d11").Value
Dim myvalQ As Variant
myvalQ = ThisWorkbook.Worksheets("Sheet1").Range("A15").Offset(0, ent_num).Value
the ent num is a number a user enters which gives this offset above, but myvalQ is the number in which the offset in the first chunk of code will follow
If Source.Worksheets("Sch Q").Range("N17").Value = "- Select -" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = none
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "GEN" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "General"
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "PAS" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "Passive"
ElseIf Source.Worksheets("Sch Q").Range("N17").Value = "901j" Then
Target.Worksheets("Sch Q").Range("D15").Offset(, myvalQ).Value = "Section 901(j)"
End If
the offset value comes from this code
Dim num_ent As Variant
ent_num = ThisWorkbook.Worksheets("File Paths").Range("d11").Value
Dim myvalQ As Variant
myvalQ = ThisWorkbook.Worksheets("Sheet1").Range("A15").Offset(0, ent_num).Value
the ent num is a number a user enters which gives this offset above, but myvalQ is the number in which the offset in the first chunk of code will follow