+ Reply to Thread
Results 1 to 5 of 5

How to execute a line-drawing subroutine/macro?

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    7

    How to execute a line-drawing subroutine/macro?

    I am a complete novice in excel and VBA scripting. I need to know how to execute this subroutine:
    Please Login or Register  to view this content.
    called like:

    Connect Range("A3"), Range("D7")

    that I found in an excel forum. My intention is to eventually be able to select two cells and then run a sub to draw a line between them. I suppose this would mean having some sort of thing to extract the cell locations from the selected cells, and then running the aforementioned subroutine with the selected cell locations as inputs.
    Last edited by Leith Ross; 04-04-2014 at 09:07 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to execute a line-drawing subroutine/macro?

    find attached example, you have to select the whole range, not only the 2 cells
    Attached Files Attached Files
    Last edited by patel45; 04-04-2014 at 11:42 PM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    04-04-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to execute a line-drawing subroutine/macro?

    Hi!

    Thanks a lot for this. However, my computer is flagging it with some message saying that it doesn't trust the file. Just to be on the safe side, could you tell me the code you used? I hate to be so skeptical, but I also want to work on my VBA coding skills.

    Also, I've been working on it myself, and I got the line drawing part to work by calling the subroutine in another macro. I want to get it to draw arrows instead of lines and take the selected cells as a range.

    Please Login or Register  to view this content.
    Thanks!

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to execute a line-drawing subroutine/macro?

    do not have to take into account the safety messages

    Please Login or Register  to view this content.
    Last edited by patel45; 04-05-2014 at 12:34 AM.

  5. #5
    Registered User
    Join Date
    04-04-2014
    Location
    Somewhere
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to execute a line-drawing subroutine/macro?

    Thanks a lot. In the meantime, I was able to actually make a program myself, although much simpler than yours. I will take a look at your code so I can understand some of the subtleties. Anyhow, for the benefit of anyone stumbling across the thread in the future, here is my bare-bones version of the program:

    Please Login or Register  to view this content.
    I was actually inspired by your idea of using a range selection to identify the cells of interest.

+ 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. Loop that waits for a subroutine to execute
    By Aristizabal95 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-02-2013, 11:38 PM
  2. Command line for open excel, insert a sheet, execute a macro, save file exit?
    By uschxc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2012, 12:28 PM
  3. How do i execute a subroutine?
    By wlan in forum Excel General
    Replies: 4
    Last Post: 11-22-2010, 02:34 AM
  4. [SOLVED] How to execute a excel subroutine from visual basic
    By Ivan Lozada in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2006, 09:55 AM
  5. Execute a macro from command line: possible or not ?
    By Drinkmilk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2006, 06:55 AM

Tags for this Thread

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