Hi,
I wrote a short code to get a unique count of a column, and I'm trying to get it to write that value in a certain cell. However, the last statement in my code is not correct where it says ActiveRange.Value = MyUnique.Count.
What am I doing wrong?
Sub SetupTest2()
'1. Select Pivot...
If I run this code as a macro it works fine but put same code in for a command button and I get a Run-time error '1004': Select method of range class failed.
Anyone help with a fix?
This is where the debug stopped in the code:
Private Sub CommandButton3_Click()
'
' DeleteInputData Macro
'...
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.