+ Reply to Thread
Results 1 to 6 of 6

Want to simplify my Macro

  1. #1
    Registered User
    Join Date
    03-10-2016
    Location
    Montreal
    MS-Off Ver
    Office for MAC 2011
    Posts
    3

    Want to simplify my Macro

    Hi,
    I'm not an expert in VBA but I like to play around and learn by myself. Unfortunately, I can't always find the answers I seek just by going through Google :/
    That's why i come here today.
    I have a Macro that changes the two following columns of a modified cell on a D8:AY259 range. It works fine, but I feel like the way I wrote it is maybe not optimal. Can someone tell me if it could be improved? Also I would like to add to my code that when there is multiple selection "then Exit Sub" and the user press delete, that the two following columns clears out as well.
    Thanks for your help!

    Please Login or Register  to view this content.
    Last edited by Hamjea1; 03-10-2016 at 03:40 PM. Reason: Specify

  2. #2
    Registered User
    Join Date
    11-08-2015
    Location
    Croatia
    MS-Off Ver
    2016
    Posts
    53

    Re: Want to simplify my Macro

    Here is some optimization:
    With this you can start:

    Please Login or Register  to view this content.
    You can help me too.

  3. #3
    Registered User
    Join Date
    03-10-2016
    Location
    Montreal
    MS-Off Ver
    Office for MAC 2011
    Posts
    3

    Re: Want to simplify my Macro

    MUUUUUUUTCH better! Hahaha! Thanks

  4. #4
    Registered User
    Join Date
    11-08-2015
    Location
    Croatia
    MS-Off Ver
    2016
    Posts
    53

    Re: Want to simplify my Macro

    Maybe you can help me now. To register on my webpage www.virtual-forms.com and become a beta tester of new concept of Excel Userforms and if you love it, maybe tell some friends about it :-)

    Davor

  5. #5
    Registered User
    Join Date
    03-10-2016
    Location
    Montreal
    MS-Off Ver
    Office for MAC 2011
    Posts
    3

    Re: Want to simplify my Macro

    Also can someone tell me if it is possible to add to my code that when there is multiple selection "then Exit Sub" and the user press delete, that the two following columns clears out as well.

    Example:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub

    But i would like that if the selected cell is deleted then
    Target.Offset(, 1).Value = " "
    Target.Offset(, 2).Value = " "

    ...

  6. #6
    Registered User
    Join Date
    11-08-2015
    Location
    Croatia
    MS-Off Ver
    2016
    Posts
    53

    Re: Want to simplify my Macro

    For the selection you can try to play with Areas >>>>> Columns and Rows:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to simplify this macro
    By aneshdas in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-14-2014, 01:11 AM
  2. [SOLVED] How to simplify Macro IF function
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-19-2013, 04:31 AM
  3. I need macro/ vba help to simplify a report
    By sjoseph in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-02-2013, 03:30 PM
  4. Simplify macro
    By iamasimpleman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2011, 07:01 AM
  5. How do I simplify this macro?
    By snooze24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2009, 04:47 PM
  6. Simplify the Macro of Looping
    By ccl28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2006, 05:20 AM
  7. [SOLVED] How do I simplify a macro in excel?
    By Erik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2005, 10:25 AM
  8. Simplify a macro
    By Einar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-23-2005, 05:05 AM

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