Code Help!! PLEASE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does any one knows why this is not working?


Private Sub ComboBox1_Change()
if me.combobox1.value = "value1" then
With Me.ComboBox1.TopLeftCell
..Offset(0, 5) = "NIN"
..Offset(0, 6) = "NOUT"
..Offset(0, 7) = "IND"
..Offset(0, 8) = "TITLE"
..Offset(0, 9) = "CASE"
End With
else
With Me.ComboBox1.TopLeftCell
..Offset(0, 5) = "something"
..Offset(0, 6) = "else"
..Offset(0, 7) = "more"
..Offset(0, 8) = "ofmy"
..Offset(0, 9) = "stuff"
End With

End Sub


Any Help Greatly appreciated.
Do I need an End If somewhere?
 
Yes, you're missing an End If!

You could try this:

Private Sub ComboBox1_Change()
With Me.ComboBox1.TopLeftCell
If Me.ComboBox1.Value = "value1" Then
.Offset(0, 5) = "NIN"
.Offset(0, 6) = "NOUT"
.Offset(0, 7) = "IND"
.Offset(0, 8) = "TITLE"
.Offset(0, 9) = "CASE"
Else
.Offset(0, 5) = "something"
.Offset(0, 6) = "else"
.Offset(0, 7) = "more"
.Offset(0, 8) = "ofmy"
.Offset(0, 9) = "stuff"
End If
End With
End Sub

hth
Garry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top