I have received a lot of help from this site through searching posts but can’t seem to figure out the answer to my problem so I thought I would ask my first questions after several days of trying to solve this on my own.
I’m trying to specify a row when the user chooses a specific command button and then reference the column from a ComboBox which would determine the cell to write to. Then write the contents of the ComboBox to the specific cell.
I can select the column and the row separately but can’t figure out the code to make them work together.
This works to choose the desired row
Code:
Private Sub CommandButton1_Click()
Dim y As Integer
y = bBldgPlan.CommandButton1.Caption ‘(i.e. caption is 100, row 100 is selected)
Rows(y).Select
This works to write the contents of the forms ComboBox to the cell but requires both column and row to be referenced. I only want the column to be referenced from the ComboBox. Writing a code that performs both the above and below functions is where I am having difficulty.
Code:
Private Sub CommandButton1_Click()
.Range("A6") = Me.ComboBox1.Value
.Range("A7") = Me.ComboBox2.Value
.Range("A8") = Me.ComboBox3.Value
End With
End Sub
Although not even close, this should give an idea of what I’m trying to do.
Code:
Private Sub CommandButton1_Click()
Dim y As Integer
y=buildgPlan.CommandButton1.Caption
.Range(“A”) & y =Me.ComboBox1.Value
.Range("B") & y = Me.ComboBox2.Value
.Range("C") & y = Me.ComboBox3.Value
End Sub
Any help would be greatly appreciated
Bookmarks