O
oberon.black
I have the following code:
Code:
--------------------
Private Sub CommandButton1_Click()
If OptionButton1 = True Then
Range("income").EntireColumn.Insert
Range("d11").Formula = TextBox1.Value
Else
Range("expense").EntireColumn.Insert
Range("f11").Formula = TextBox1.Value
End If
Unload Me
End Sub
Private Sub OptionButton1_Click()
Me.OptionButton1.Value = True
End Sub
--------------------
I want to make sure that the newly inserted column is always placed in
front of either the 'income' column or in front of the 'expense'
column depending on what is choosen by the option buttons. I also want
the textbox to label that new column.
I know that the problem is in the 'Range("f11").Formula =
Textbox1.Value' portion of my code but I do not know how to make this
code follow the name range and always insert the column in front of it
with the textbox given name.
Code:
--------------------
Private Sub CommandButton1_Click()
If OptionButton1 = True Then
Range("income").EntireColumn.Insert
Range("d11").Formula = TextBox1.Value
Else
Range("expense").EntireColumn.Insert
Range("f11").Formula = TextBox1.Value
End If
Unload Me
End Sub
Private Sub OptionButton1_Click()
Me.OptionButton1.Value = True
End Sub
--------------------
I want to make sure that the newly inserted column is always placed in
front of either the 'income' column or in front of the 'expense'
column depending on what is choosen by the option buttons. I also want
the textbox to label that new column.
I know that the problem is in the 'Range("f11").Formula =
Textbox1.Value' portion of my code but I do not know how to make this
code follow the name range and always insert the column in front of it
with the textbox given name.