Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have the following two macros in Excel. The only thing is they take a lot of space and time to type, because below I have the first three objects, but it will have to be 250 objects! So can somebody help me rewrite these two macros so that they will be a lot shorter? Thanks in advance! Sub ChangeComboBoxProperties() Dim ComboBox1 As OLEObject Dim ComboBox2 As OLEObject Dim ComboBox3 As OLEObject Dim ws As Worksheet Set ws = ActiveSheet Set ComboBox1 = ws.OLEObjects("ComboBox1") With ComboBox1 ..LinkedCell = "'Rekenblad uitgangspunten WVB'!D3" ..ListFillRange = "'Rekenblad uitgangspunten WVB'!C3:C5" End With Set ComboBox2 = ws.OLEObjects("ComboBox2") With ComboBox2 ..LinkedCell = "'Rekenblad uitgangspunten WVB'!D6" ..ListFillRange = "'Rekenblad uitgangspunten WVB'!C6:C8" End With Set ComboBox3 = ws.OLEObjects("ComboBox3") With ComboBox3 ..LinkedCell = "'Rekenblad uitgangspunten WVB'!D9" ..ListFillRange = "'Rekenblad uitgangspunten WVB'!C9:C11" End With End Sub -------------------------------------------------------------------- Sub ChangeFormula() Sheets("Begroting WVB").Activate Range("M12").FormulaR1C1 = "'Rekenblad uitgangspunten WVB'!F3" Range("M13").FormulaR1C1 = "'Rekenblad uitgangspunten WVB'!F6" Range("M14").FormulaR1C1 = "'Rekenblad uitgangspunten WVB'!F9" End Sub -- leonidas ------------------------------------------------------------------------ leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375 View this thread: http://www.excelforum.com/showthread...hreadid=553945 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there away to shorten | Excel Worksheet Functions | |||
Any way to shorten this up? | Excel Worksheet Functions | |||
Shorten A Name | Excel Discussion (Misc queries) | |||
Can I shorten this? | Excel Programming | |||
Is there a way to shorten this? | Excel Programming |