Need help with spin buttons.

X82

New Member
Joined
Apr 14, 2011
Messages
32
Hi there.
I have a worksheet with multiple columns. Column B is where I want 250 spin buttons to be, and show its results in column C. I did this with a macro I found:

Code:
Sub add_spinner()
With ActiveSheet
For i = 4 To 235
   Set cb = .Shapes.AddFormControl(xlSpinner, 150, i * 30, 120, 30)
   cb.ControlFormat.LinkedCell = "E" & i
   Next
End With
End Sub

When I run said macro, I have to select all the spin buttons and drag them to column B, since the macro makes them appear towards the left of the sheet.
I was hoping that someone could tell me if there was a way of making these 250 spin buttons appear where I want, like column G then J etc. At the moment I create 250, select one, ctrl+A then drag them. But of course if I add another 250 more and go ctrl+A, all my spin buttons are selected. Only option I found was to ctrl+right click on each of my new spin buttons, but with 250 and more columns to go, I don't think so.
Any ideas?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try

Code:
Sub add_spinner()
With ActiveSheet
    For i = 4 To 235
       Set cb = .Shapes.AddFormControl(xlSpinner, 150, i * 30, 120, 30)
       cb.ControlFormat.LinkedCell = "E" & i
        With .Range("B" & i)
            cb.Top = .Top
            cb.Left = .Left
        End With
    Next
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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