+ Reply to Thread
Results 1 to 2 of 2

Streamlining Code

Hybrid View

  1. #1
    Registered User
    Join Date
    02-12-2007
    Posts
    7

    Streamlining Code

    I have this code which repeats itself to accomodate different ranges - about 20 when im finished.
    Is there a better way of doing it using maybe Case statements?

    thanks
    Sally

    If Not Intersect(Target, Range("dType")) Is Nothing Then
    Sheets("variables").Range("qType").Value = Target.Value
    Range("A1").Select

    ElseIf Not Intersect(Target, Range("dDate")) Is Nothing Then
    Sheets("variables").Range("qDate").Value = Target.Value
    Range("A1").Select

    ElseIf Not Intersect(Target, Range("dClass")) Is Nothing Then
    Sheets("variables").Range("qClass").Value = Target.Value
    Range("A1").Select


    End If

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Streamlining Code

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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