Please help. Need Command button hide/ make disappear if cell range is empty.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,

I have vba code that bring in data from another worksheet with certain conditions and paste it in range C7:G7, C8:G8, C9:G9 and so on...

Corresponding to each row in H col I have 7 Rounded Rectangle shape inserted from insert tab and is assigned a macro to it.

What i want is the macro to make this Rounded Rectangle or command button disappear or make it transparent if there is no value ("blank") in corresponding row...

This could be difficult but please help me if this is possible.

I am trying it myself!;)

Thanks for helping!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I have recorded something that might helping adding to the code....

I have writen few words whic is still not working
Please advice
Code:
sub try1()
if range("C7:G7").value = "" then
ClassType:="Forms.OptionButton.1", Link:=False, _
        DisplayAsIcon:=false
else
ClassType:="Forms.OptionButton.1", Link:=False, _
        DisplayAsIcon:=true
End sub

Code:
Sub Macro3()
'
' Macro3 Macro
'
'
    ActiveSheet.OLEObjects.Add(ClassType:="Forms.OptionButton.1", Link:=False, _
        DisplayAsIcon:=True, Left:=144, Top:=279, Width:=136.5, Height:=16.5 _
        ).Select
End Sub
 
Upvote 0
I am still trying you see? Please advice it is still not working....

Please :rolleyes:
Code:
Sub try2()
Dim OLEObjects As Object
If Range("C7:G7").Value = "" Then
    OLEObjects.Add(ClassType:="Forms.OptionButton.1", Link:=False, _
        DisplayAsIcon:=False, Left:=144, Top:=279, Width:=136.5, Height:=16.5 _
        ).Select
        Else
        OLEObjects.Add(ClassType:="Forms.OptionButton.1", Link:=False, _
        DisplayAsIcon:=True, Left:=144, Top:=279, Width:=136.5, Height:=16.5 _
        ).Select
End If
End Sub
 
Upvote 0
Thanks i figured out something....
thanks have Great weekend guys!!!

;)
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top