+ Reply to Thread
Results 1 to 4 of 4

Save data from UserForm textbox to a cell

  1. #1
    Registered User
    Join Date
    01-31-2022
    Location
    Mesa, AZ
    MS-Off Ver
    Office 365
    Posts
    46

    Save data from UserForm textbox to a cell

    I have a user form that pops up when someone enters rejected in a cell in row AA. I need the form to unload into the corresponding cell in column AE. Unsure of how to get this done.

    Please Login or Register  to view this content.
    Not sure of how to get this done.
    Last edited by 6StringJazzer; 03-30-2023 at 03:27 PM. Reason: better titles please

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Unload my form

    We can't figure out what you want to do by looking at code that doesn't do what you want to do. This code puts data from a cell into the form, in a control of some kind called REJECT. What do you want to do that is different from that?

    We also can't help at all with no information about your form. What controls on the form are relevant to your problem?

    I suggest you attach your Excel file so we can see the big picture.

    Also I suggest you not use the term "unload" because that means something very specific when you are talking about userforms, and it's different than what you mean here. I think you want to "Save data from user form to a cell".
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-31-2022
    Location
    Mesa, AZ
    MS-Off Ver
    Office 365
    Posts
    46

    Re: Unload my form

    Apologies. I would like to have the contents of the Text Box (Named Reject) in the User Form (REJECTED) to populate into the cell in column AC when the user clicks OK. Per your request I uploaded a sample.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Save data from UserForm textbox to a cell

    You have a couple of different problems here.

    First of all the code you showed above does not exist in this file.

    The user form collects a reason for rejection if the value in AA is "Rejected". However, the data validation in column AA does not allow the user to enter "Rejected", only "Approved". Second, AA is for Level 1, and there is no column for "Level 1 Reason for Rejection". AC is "Level 1 Approver", and AE is "Level 2 Approval Date". AG is "Level 2 Reason for Rejection", but there isn't one for Level 1.

    I have added a Submit button to the form to explicitly close it. The user can close it with the X but it is not intuitive that is what they are supposed to do. There is a button there but it's just a graphic, and there is no code associated with it so nothing will happen when you click it. No idea what you had in mind there.

    I have corrected your code in the file but you still need to sort out exactly which column you want the result to go in.

    Last, I strongly recommend to everyone that they use Option Explicit and declare variables. Doing so prevents a lot of bugs and runtime errors.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. VBA Form Not Unloading / Memory Stuck - How to unload top form correctly
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-20-2018, 10:28 PM
  2. [SOLVED] vba form to unload to row 2
    By Quicksnot in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 12-03-2013, 02:10 PM
  3. How to unload the form
    By Quicksnot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-30-2013, 11:01 AM
  4. How to show/hide/unload form when form name is a string variable?
    By achmidt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 06:21 PM
  5. Don't unload the form
    By benj in forum Excel General
    Replies: 0
    Last Post: 04-14-2005, 03:59 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