LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can you shorten these macros?


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there away to shorten Steved Excel Worksheet Functions 2 April 17th 08 08:21 PM
Any way to shorten this up? Kevin M Excel Worksheet Functions 2 November 6th 06 07:50 PM
Shorten A Name rocket0612 Excel Discussion (Misc queries) 3 June 14th 05 11:37 AM
Can I shorten this? TyeJae[_26_] Excel Programming 5 November 25th 04 01:35 AM
Is there a way to shorten this? TyeJae[_7_] Excel Programming 4 June 15th 04 01:51 AM


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"