G
GregJG
I am having problems with the following code. I can get 1 textbo
created with the correct value, as long as only 1 checkbox is true. bu
if they both are true, only one textbox is created and no value.
can anyone see what I am doing wrong or help to improve code?
Set wb = Workbooks.Open("PATH")
If MultiPage1.Pages(0).Checkbox1.Value = True Then
Set NewTextBox = MultiPage1.Pages(1).Add("forms.textbox.1")
With NewTextBox
.Width = 150
.Height = 18
End With
Set rng
wb.Worksheets("Sheet1").Columns(1).find(MultiPage1.Pages(0).Checkbox1.Caption)
If Not rng Is Nothing Then
MultiPage1.Pages(1).TextBox1 = rng.Offset(0, 1)
End If
End If
If MultiPage1.Pages(0).checkbox2.Value = True Then
Set NewTextBox = MultiPage1.Pages(1).Add("forms.textbox.1")
With NewTextBox
.Width = 150
.Height = 18
End With
Set rng
wb.Worksheets("sheet1").Columns(1).find(MultiPage1.Pages(0).checkbox2.Caption)
If Not rng Is Nothing Then
MultiPage1.Pages(1).TextBox2 = rng.Offset(0, 1)
End If
End I
created with the correct value, as long as only 1 checkbox is true. bu
if they both are true, only one textbox is created and no value.
can anyone see what I am doing wrong or help to improve code?
Set wb = Workbooks.Open("PATH")
If MultiPage1.Pages(0).Checkbox1.Value = True Then
Set NewTextBox = MultiPage1.Pages(1).Add("forms.textbox.1")
With NewTextBox
.Width = 150
.Height = 18
End With
Set rng
wb.Worksheets("Sheet1").Columns(1).find(MultiPage1.Pages(0).Checkbox1.Caption)
If Not rng Is Nothing Then
MultiPage1.Pages(1).TextBox1 = rng.Offset(0, 1)
End If
End If
If MultiPage1.Pages(0).checkbox2.Value = True Then
Set NewTextBox = MultiPage1.Pages(1).Add("forms.textbox.1")
With NewTextBox
.Width = 150
.Height = 18
End With
Set rng
wb.Worksheets("sheet1").Columns(1).find(MultiPage1.Pages(0).checkbox2.Caption)
If Not rng Is Nothing Then
MultiPage1.Pages(1).TextBox2 = rng.Offset(0, 1)
End If
End I