albertc30
Well-known Member
- Joined
- May 7, 2012
- Messages
- 1,091
- Office Version
- 2019
- Platform
- Windows
Hi all.
It's been a while since my last post. As usual, here I am, back with more questions and still as dumb as a donkey! I'll never grasp this coding thing I don't think.
Anyways, to the chase. I have a field with a dropdown list that will have either Invoice or proforma. Consequently I have two command buttons one for Invoices and the other for proforma.
Depending on what's selected on the cell I want the correct button to become active. I have used the following code and more, but to no avail.
Trust me, I have been at it for the past 2 hours almost.
I have used either of the above but I'm out of luck and tiered. I'm sure, as usual this is basic stuff but I'm out of ideas.
As usual, any help is always truly appreciated.
Regards,
Albert
It's been a while since my last post. As usual, here I am, back with more questions and still as dumb as a donkey! I'll never grasp this coding thing I don't think.
Anyways, to the chase. I have a field with a dropdown list that will have either Invoice or proforma. Consequently I have two command buttons one for Invoices and the other for proforma.
Depending on what's selected on the cell I want the correct button to become active. I have used the following code and more, but to no avail.
Trust me, I have been at it for the past 2 hours almost.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("E3").Value = "Invoice" Then
Sheet1.CBProformas.Enabled = False
Sheet1.CBInvoices.Enabled = True
Else
Sheet1.CBProformas.Enabled = True
Sheet1.CBInvoices.Enabled = False
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("E3").Value = "Invoice" Then
Sheet1.CBProformas.Enabled = False
Sheet1.CBInvoices.Enabled = True
Else
Sheet1.CBProformas.Enabled = True
Sheet1.CBInvoices.Enabled = False
End If
End Sub
I have used either of the above but I'm out of luck and tiered. I'm sure, as usual this is basic stuff but I'm out of ideas.
As usual, any help is always truly appreciated.
Regards,
Albert