ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Same Size Box (https://www.excelbanter.com/excel-programming/367665-creating-same-size-box.html)

RigasMinho

Creating Same Size Box
 
Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks


Tom Ogilvy

Creating Same Size Box
 
for checkboxes from the control toolbox toolbar located on a worksheet.

Sub sizecheckboxes()
Dim cbox as MSForms.checkbox
Dim cbox1 as MSForms.Checkbox
Dim obj as OleObject
set cbox = Worksheets.OleObjects("CheckBox1").Object
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.Checkbox then
set cbox1 = obj.Ojbect
if cbox1.name < cbox.Name then
cbox1.Width = cbox.Width
cbox1.Height = cbox.Height
end if
end if
next
end Sub

--
Regards,
Tom Ogilvy

"RigasMinho" wrote:

Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks



RigasMinho

Creating Same Size Box
 
man that sucks - you have to program in command to do this?

this really sucks

But thanks

Tom Ogilvy wrote:
for checkboxes from the control toolbox toolbar located on a worksheet.

Sub sizecheckboxes()
Dim cbox as MSForms.checkbox
Dim cbox1 as MSForms.Checkbox
Dim obj as OleObject
set cbox = Worksheets.OleObjects("CheckBox1").Object
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.Checkbox then
set cbox1 = obj.Ojbect
if cbox1.name < cbox.Name then
cbox1.Width = cbox.Width
cbox1.Height = cbox.Height
end if
end if
next
end Sub

--
Regards,
Tom Ogilvy

"RigasMinho" wrote:

Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks




Tom Ogilvy

Creating Same Size Box
 
then why wouldn't you just copy all from the same master box.

--
Regards,
Tom Ogilvy


"RigasMinho" wrote:

man that sucks - you have to program in command to do this?

this really sucks

But thanks

Tom Ogilvy wrote:
for checkboxes from the control toolbox toolbar located on a worksheet.

Sub sizecheckboxes()
Dim cbox as MSForms.checkbox
Dim cbox1 as MSForms.Checkbox
Dim obj as OleObject
set cbox = Worksheets.OleObjects("CheckBox1").Object
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.Checkbox then
set cbox1 = obj.Ojbect
if cbox1.name < cbox.Name then
cbox1.Width = cbox.Width
cbox1.Height = cbox.Height
end if
end if
next
end Sub

--
Regards,
Tom Ogilvy

"RigasMinho" wrote:

Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks





RigasMinho

Creating Same Size Box
 
Cause i'm weird like that :-)

In reality in VB you can set a box and use that as a control and then
resize boxes that way.

I thought VBA would have the same functionality.

Oh well
Tom Ogilvy wrote:
then why wouldn't you just copy all from the same master box.

--
Regards,
Tom Ogilvy


"RigasMinho" wrote:

man that sucks - you have to program in command to do this?

this really sucks

But thanks

Tom Ogilvy wrote:
for checkboxes from the control toolbox toolbar located on a worksheet.

Sub sizecheckboxes()
Dim cbox as MSForms.checkbox
Dim cbox1 as MSForms.Checkbox
Dim obj as OleObject
set cbox = Worksheets.OleObjects("CheckBox1").Object
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.Checkbox then
set cbox1 = obj.Ojbect
if cbox1.name < cbox.Name then
cbox1.Width = cbox.Width
cbox1.Height = cbox.Height
end if
end if
next
end Sub

--
Regards,
Tom Ogilvy

"RigasMinho" wrote:

Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks






NickHK

Creating Same Size Box
 
If these are on a worksheet, select the controls you wish to resize,
right-click one of them Format ControlSize, enter the desired dimensions.
If you talking about on a userform, same as VB6.

NickHK

"RigasMinho" wrote in message
oups.com...
Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks




RigasMinho

Creating Same Size Box
 
THANKS this is what i needed :-)
NickHK wrote:
If these are on a worksheet, select the controls you wish to resize,
right-click one of them Format ControlSize, enter the desired dimensions.
If you talking about on a userform, same as VB6.

NickHK

"RigasMinho" wrote in message
oups.com...
Hey - in VBA you know how you can create boxes whether it be a texbox /
label box / check box etc etc

I created about 10 checkboxes - is there a way to make them the same
size w/o using copy and paste.

Like highlight one box and make them the same size of that box?

Let me know thanks




All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com