Results 1 to 3 of 3

Proper syntax to shorten and speed up code

Threaded View

Mitchy123 Proper syntax to shorten and... 08-04-2013, 05:06 PM
HaHoBe Re: Proper syntax to shorten... 08-04-2013, 05:17 PM
TMS Re: Proper syntax to shorten... 08-04-2013, 05:19 PM
  1. #1
    Registered User
    Join Date
    08-04-2013
    Location
    Worcester, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Proper syntax to shorten and speed up code

    Hi guys,

    Mitch here! really hoping to get some help with an extremely simple piece of coding.

    I am fairly new to this as you can probably tell from my poor first attempt at the coding. Its extremely simple, and just requires certain data to show when specific a option is chosen from a choice of option tabs/buttons.

    Due to the length of the code, it is very slow. I have tried all different methods of shortening the code but to no avail!

    Any help on this would be very welcome.

    coding is as follows and is fairly laughable compared to the level I have seen on here!

    If OptionButton1 = True Then
    Worksheets("Background").Range("C56") = ("April")
    Worksheets("Background").Range("B60") = Worksheets("Background").Range("B3")
    Worksheets("Background").Range("B61") = Worksheets("Background").Range("B4")
    Worksheets("Background").Range("B62") = Worksheets("Background").Range("B5")
    Worksheets("Background").Range("B63") = Worksheets("Background").Range("B6")
    Worksheets("Background").Range("B64") = Worksheets("Background").Range("B7")
    Worksheets("Background").Range("B65") = Worksheets("Background").Range("B8")
    Worksheets("Background").Range("B66") = Worksheets("Background").Range("B9")
    Worksheets("Background").Range("B67") = Worksheets("Background").Range("B10")
    Worksheets("Background").Range("B68") = Worksheets("Background").Range("B11")
    Worksheets("Background").Range("B69") = Worksheets("Background").Range("B12")
    Worksheets("Background").Range("B70") = Worksheets("Background").Range("B13")
    This carries on approx. 20 more lines for another 2 option buttons hence the slow update when choosing the options...

    I have tried entering the range as "B60:B70" but the sheet doesn't react and update the data.

    I have also tried 'Dim' but due to my rookie level can't seem to get it to work.

    As I have mentioned, I would love some sort of help!

    Perhaps some day I will be giving advice on here but at the moment, this seems unlikely!



    Thank you in advance...

    Mitch
    Last edited by jeffreybrown; 08-04-2013 at 05:13 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Proper IF syntax when using in VBA
    By scott28 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2013, 06:25 AM
  2. [SOLVED] proper syntax
    By lundy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2012, 01:44 PM
  3. Proper syntax to shorten Countif formula
    By small_wonder in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-01-2012, 09:23 AM
  4. Shorten and speed up code
    By Kr4ftw3rk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2008, 11:55 AM
  5. [SOLVED] Proper SQL Syntax - DAO
    By MSweetG222 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2006, 05:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1