+ Reply to Thread
Results 1 to 7 of 7

Printing selected items as a form - editing the macro

  1. #1
    Registered User
    Join Date
    09-29-2007
    Posts
    5

    Printing selected items as a form - editing the macro

    Hi there,

    I am new to macros, so please bear with me. I am not used to editing the codes, and I am unfamiliar with the slang. So far, I am doing my best... here goes my question.

    I wanted to print specific information into an invoice. I found a code to use... I copied this code from this site:

    http://www.contextures.com/xlForm03.html

    It works fine, but I would like to tailor it a bit. Can someone suggest a way for me to a)use "p" instead of "x" as the data indicator; b)change the range so that I can use specific cells in a row, instead of ALL cells in a row.

    Thank you. I hope that I made enough sense for you =)

    Best

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    As written, anything can be used to "mark a row".

    This line details where data is put into the form/worksheet to be printed.
    Please Login or Register  to view this content.
    As written, the code puts the first 7 values on a marked row into that output sheet. If you want to control which columns on a marked row go to the output sheet.

    Add
    Please Login or Register  to view this content.
    immediatly after the myAddresses line.
    And change the line to this:
    Please Login or Register  to view this content.
    By changing the 1,2,3,..,7 to the columns you want, you will get the control you want. Make sure that the myInputColumns is as large (or larger than) the myAddress array.

  3. #3
    Registered User
    Join Date
    09-29-2007
    Posts
    5
    Amazing! Thank you

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    You're welcome

  5. #5
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342
    Hi mikerickson,
    I am new to macro coding but I seek your help in explaining the following:-
    'cells to copy from Input sheet - some contain formulas
    myCopy = "D5,D7,D9,D11,D13"

    what is D5,D7,D9.......? what does it represent? If I want to copy more columns,how do I do it,Thanks a million

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I can't find that quote in any of the references in this thread. (Unless it is from the contexures link in the OP, other users of this forum would benifit more if this discussion were its own thread.

    If it is code, then
    Please Login or Register  to view this content.
    The apostrophy at the start of the first line indicates that that line is a comment.
    The next line sets the variable myCopy to the string "D5,D7,D9,D11,D13"

    I would need to see the rest of the code to tell you how it fits together.

    Since those cell addresses are all in the same column, we definatly would need to see the code to make it work on more than column D.

    Please start a new thread. If you post the code in that thread, please wrap it.

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

    Please read forum rules & wrap your VBA code

    A thread with the rules is available at the top of each forum or see links below

    If you do not understand the VBA code wrap instructions have a look at my last reply in this thread
    http://www.excelforum.com/showthread.php?t=583950
    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