+ Reply to Thread
Results 1 to 10 of 10

Type in two sheets at once

  1. #1
    Registered User
    Join Date
    03-09-2015
    Location
    Grand Island
    MS-Off Ver
    2013
    Posts
    9

    Type in two sheets at once

    I'm a newbie at forums and VBA. I've been working a short time with VBA and like it. I want to type info into a row of cells in Sheet 1. Have that same info go into various cells in Sheet 2(A form that will be printed.). Once the last cell in Sheet 1 is typed have the filled row move down leaving a new blank row for the next set of entries starting the process over. It would be nice to have the form print at the end of data entry. I hope I've been clear and thanks for the help.
    Last edited by raywilexel; 04-05-2015 at 01:53 PM. Reason: Bad title

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

    Re: Type in two sheets at once

    When you go to the new row, what do you want to happen in Sheet2?

    The user is typing in Sheet1.
    They put data in A1 and that data is copied into Sheet2!A1
    They put data is B1 and that data is copied into Sheet2!C3
    The press Return, and the data moves from Sheet1A1:B1 to Sheet1A2:B2 and the cursor moves to Sheet1A1
    What happens to the data in Sheet2?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    03-09-2015
    Location
    Grand Island
    MS-Off Ver
    2013
    Posts
    9

    Re: Type in two sheets at once

    The form(Sheet2) prints. Thanks

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

    Re: Type in two sheets at once

    When does it print?
    Do you want the user to tell it to print? or do you want it to be automatic when Sheet1! row 1 is completely filled out.
    Do you want the user to have a chance to abort the printing?

    It almost sounds like the logic could be
    "Every time that Sheet2 is printed, clear Sheet2, move Sheet1's data down a row and move the cursor to Sheet1!A1"

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

    Re: Type in two sheets at once

    If you have formulas like =Sheet1$A$1 in the cells of Sheet2.
    And if a row is filled when there is data in all of the cells of A1:I1, you could put this in the code module for Sheet1.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-09-2015
    Location
    Grand Island
    MS-Off Ver
    2013
    Posts
    9

    Re: Type in two sheets at once

    Your logic statement is correct. The user will need to initiate printing, with abort option. Not all cells will have input. Some instances only certain cells will have info placed in them. I'm not sure if the user tabs through each cell and when the last one is reached the print option comes into play. I'm familiarizing myself with some of the commands in your code to get a better grip on their use. I tried at first to do this as a recorded macro...didn't work so well. Thanks again for the lesson. I'll walk though the code to get a better sense...

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

    Re: Type in two sheets at once

    As written, this will start the process when all of the cells in A1:I1 are filled.

    If you want the user to press a PrintButton, do not use the Change event code.

    Put the PrintForm code in a normal module and either have the user call it from the dialog box or assign it to a button or one of the other ways for the user to trigger a sub.

  8. #8
    Registered User
    Join Date
    03-09-2015
    Location
    Grand Island
    MS-Off Ver
    2013
    Posts
    9

    Re: Type in two sheets at once

    Thanks I've got some studying to do to better understand the different types of modules, this is a great start. I think a button will be the direction to go. I could use an example of the replacement code.

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

    Re: Type in two sheets at once

    Its the same code as the sub PrintForm that is above.

  10. #10
    Registered User
    Join Date
    03-09-2015
    Location
    Grand Island
    MS-Off Ver
    2013
    Posts
    9

    Re: Type in two sheets at once

    I did some work with code now and see. Thanks again

+ 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. Using a macro on workbook1 to create a button in wb2 and assigning macro "wb2!macro"
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 11:39 AM
  2. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  3. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  4. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  5. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 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