+ Reply to Thread
Results 1 to 5 of 5

How to Print taking input & changing other dependent cell values accordingly?

  1. #1
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    How to Print taking input & changing other dependent cell values accordingly?

    In my "Attend" sheet, it contains a formula. If the value in cell A1 changes from 1 to 50000, then other dependent cells get changed accordingly. I need a VBA code for excel that will ask for a range of numbers to enter into cell "Attend!A1" and will print the page (e.g. Attend!A1:G33), changing other dependent cell values accordingly.
    For instance, for first value of given range, it will changes other dependent cell values and print first page, then from the given range it will print second page changing other dependent cell values accordingly. Thus changing other dependent values for other pages taken from input range successively.

    I found following code online that works fine, but it creates a hundred different files for 1-100 (one hundred) inputs and sends them to the printer, which causing the device to slow down or hang.
    Is it possible to send all the updates of the input to the printer in one file (or print preview) or can the update of all the data of the input be PDF together with any VBA code?
    I will be grateful if anyone can help me.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Ariful Islam; 04-25-2023 at 12:14 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: How to Print taking input & changing other dependent cell values accordingly?

    No formulas on the Attend sheet row four.

    Please Login or Register  to view this content.
    Last edited by protonLeah; 04-25-2023 at 10:22 PM.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    Re: How to Print taking input & changing other dependent cell values accordingly?

    First off, I apologize for the delayed response. I was a bit busy.

    However, I am very honored to see that a "forum guru" has come forward to solve the problem of a common member like me.

    The code you provided solved my problem to the desired extent. I thought it might not be possible to solve it in VBA code; we have to take help from 'MS Access'. The reality is that you have finished this challenging work using VBA code.

    I feel embarrassed to ask for more help after all the time and effort you have put into helping me.
    If you ever free, notice that when the code is run and no input is given, it shows error code '9," (Subscript out of range). Also, it would have been nice to see a 'No input given' message.

    Also, instead of sending the file to the printer, I would have benefited from having the code to PDF the output data in the same folder.

    Also, what would the code look like if I kept the 'Attend' sheet hidden?

    I appreciate you taking the time to decipher my lengthy and complicated code.
    Thanks once again.
    Last edited by Ariful Islam; 04-26-2023 at 08:13 AM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: How to Print taking input & changing other dependent cell values accordingly?

    • it would have been nice to see a 'No input given' message (ok)
    • PDF the output (ok)
    • You can't copy hidden sheet.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    Re: How to Print taking input & changing other dependent cell values accordingly?

    When I ran the given code, the compiler didn't show any 'errors'. The desired and accurate output is obtained in one go.

    However, When a person's expectations and wishes are met, it is only possible to interpret his or her level of happiness by looking at their "facial expression." Looking at the tiny wording won't help you grasp my delight or my current mood. If you saw me, you could understand how good I feel. I am very very grateful to you.
    Prayer: May God bless your talent and work. God bless you.
    Last edited by Ariful Islam; 04-27-2023 at 08:09 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. Macro to replace values in Excel taking from user input.
    By sunilsai in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2016, 06:43 AM
  2. Need macro code for filling values in Sheet 2 by taking input parameters from Sheet1
    By ashaanna88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2012, 09:32 AM
  3. Replies: 1
    Last Post: 09-30-2012, 07:35 PM
  4. [SOLVED] 2nd value in cell range dependent on changing values other cells (dynamic?)
    By RUJedi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2012, 07:34 PM
  5. Changing the same cell value dependent on input.
    By hamspankin1 in forum Excel General
    Replies: 2
    Last Post: 03-23-2011, 08:44 AM
  6. Print area changing with input
    By Fast Forward in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-13-2007, 08:11 PM
  7. New to excel, having trouble changing values based on an input cell
    By MyUserName in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-18-2006, 10:20 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