+ Reply to Thread
Results 1 to 16 of 16

UserForm to View and Edit data in a closed workbook

  1. #1
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    UserForm to View and Edit data in a closed workbook

    Hi Everyone,

    I would like the form i created to find data from a different workbook, then if needed i will be able to change the data in the other workbook.

    I failing at the first hurdle, getting the information to show in the userform!

    My initial thought (as seen in the Search.xlsm Document) is to have the vba open the document then close it once it has retrieved the search, is this best practice or is there another way to do this?

    Ive tried myself to get it working however it wont do it and i get an error so i must be missing something somewhere so i would greatly apreciate your help.

    Capture.PNG

    im also confused on how i would get the check box to check if cell = "Y"

    TIA
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    1) The Look Up table should be
    Please Login or Register  to view this content.
    2) You are Looking up String vs Numeric
    Please Login or Register  to view this content.
    3) However, when you enter the number that is not in the list then it ends up with Run time Error, so you need to check if the number exists.
    So, after all
    Please Login or Register  to view this content.
    Last edited by jindon; 07-18-2019 at 08:22 AM.

  3. #3
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    all i get is no such number however that number is definately in there

  4. #4
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    anybody got any more ideas? also how would i do it if i was searching for something in column c for example? am i wrong to think vlookup only looks for the 1st column of what is selected
    Last edited by mtwa1990; 07-19-2019 at 02:52 PM.

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: UserForm to View and Edit data in a closed workbook

    if you are searching in column c when the criteria starts at a previous column, then use MATCH and INDEX. plenty of help on the internet for that.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    Quote Originally Posted by mtwa1990 View Post
    all i get is no such number however that number is definately in there
    Post your changed code.

  7. #7
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    This is what i have updated to the above code
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    fantastic thank you, now you maybe able to help with how i would put code in to enable me to update the workbook when i click update.

    For example if i change the outcome to complete and click update then that would change that information in the workbook, i only need it for the email tick box, the process stage and outcome text box

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    would that code change much if i swapped the numbtxt textbox with the idtxt textbox?

    so now the search form will look for the ID number in column G instead of the number in column A, so when i change the data and click update_click how will that code youve sent change?

    temp = me.numbtxt will now become text =me.idtxt however i do not know how to change the rest.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    Did you change the order of myList?

    I didn't looked at carefully...

    If you give me the column index that matches to each control names, it would be easier.

  13. #13
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    numbtxt - column 1
    contacttxt - column 2
    exttxt - column 3
    storetxt - column 4
    mgrtxt - column 5
    mtrtxt - column 6
    idtxt - column 7
    admintxt - column 8
    officetxt - column 9
    valuetxt - column 10
    securetxt - column 11
    emailchk - column 12
    stagetxt - column 13
    outcome - column 14
    commentstxt - column 15

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    Then try change myList to
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    05-11-2019
    Location
    Leicester, England
    MS-Off Ver
    Office 365
    Posts
    52

    Re: UserForm to View and Edit data in a closed workbook

    What i mean is when i enter a number in the search box i want it to search for that number in column 7.

    How do i then update that information as the code you supplied above will only work looking for the value in the 1st columns then change the data in the rest of the columns

    I want it to find the value in the 7th column and change the data in columns 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,520

    Re: UserForm to View and Edit data in a closed workbook

    change to
    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 06-05-2017, 08:04 AM
  2. [SOLVED] Populate a userform listbox with data from another workbook that is closed
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2015, 05:54 AM
  3. Create Userform to Edit, View, Remove and Find next/ previous data
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2015, 11:00 PM
  4. Userform to View, Edit, Add and Remove Data
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2015, 11:33 PM
  5. excel userform pull data from closed workbook
    By thameem127 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-23-2013, 01:53 PM
  6. Excel VBA Userform - Sets of data, View original, add new, edit existing
    By newzealdan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2011, 03:54 AM
  7. Getting Data from closed workbook into userform
    By www.butterflysystems.co.uk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2006, 05:00 PM

Tags for this Thread

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