+ Reply to Thread
Results 1 to 9 of 9

Replace Cell Value From Range Then Print Worksheet

  1. #1
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Replace Cell Value From Range Then Print Worksheet

    Hello all,

    I want the value of cell D4 to be replaced one at a time from the list of ID numbers if greater than zero (I6:I28) then the worksheet printed each time. I have set the print area for the worksheet already.


    Is this possible to do with a macro?

    Thank you very much for your help

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Replace Cell Value From Range Then Print Worksheet

    Hi BillyRaySpivy,

    Give this a shot:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Replace Cell Value From Range Then Print Worksheet

    Okay I tried it. What happened was the print popup showed quickly I think 4 times but only the first sheet actually printed.
    Attached Files Attached Files
    Last edited by BillyRaySpivy; 02-01-2017 at 02:53 PM.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Replace Cell Value From Range Then Print Worksheet

    I ignored your button, had to clear code in a module because it is not in a sub and wouldn't let code run. Pated my code in Module3, and ran it, got 4 printouts. I assume the issue has to do with your printer or printer driver, try adding a delay between printouts...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Replace Cell Value From Range Then Print Worksheet

    Wow that works fantastic! There is one more request please if possible. On my worksheet I have a column L for Check. Could this code also put a checkmark showing they were printed?

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Replace Cell Value From Range Then Print Worksheet

    Ok try this, I changed the code to check if I is > 0 and also check to see if there is a checkmark already in L before printing

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Replace Cell Value From Range Then Print Worksheet

    Perfect! Thank you very much for the support. Have a great rest of your day.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Replace Cell Value From Range Then Print Worksheet

    Thanks, you too! Thanks for marking the thread as solved, and the rep

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Replace Cell Value From Range Then Print Worksheet

    BillyRay,

    Odd, I just noticed I made a mistake putting the delay OUTSIDE the loop so it should not have made much difference, the code below fixes that, but maybe you don't need the wait command at all... test with it removed. You will have to set the correct password in this code, but it should fix the error when you protect the sheet (code just unprotects to start and then protects it again).

    Please Login or Register  to view this content.
    Last edited by Arkadi; 02-06-2017 at 11:06 AM.

+ 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. [SOLVED] for each row in range print worksheet with data from row
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2016, 05:04 AM
  2. [SOLVED] Setting print range for large worksheet
    By wayneao in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2014, 02:24 PM
  3. Scan barcodes, replace cell with next one after print action
    By MaliExcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2014, 07:36 AM
  4. Replies: 3
    Last Post: 05-26-2014, 02:21 AM
  5. VBA to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM
  6. Code to print a range of cells in a worksheet.
    By Cushionsupplier in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2010, 06:52 AM
  7. [SOLVED] Can you get the range reference for each page in a worksheet print range?
    By Crosby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2005, 02:06 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