Updating cells from user form

Royker

New Member
Joined
Sep 8, 2014
Messages
3
I have an excel spreadsheet that contains inventory information. The spreadsheet is referenced by a user form where the user enters a part number in a text box and a command button executes a WorksheetFunction to find all the corresponding cells and displays each bit of info in a different text box. In the user form there is the means to edit certain info and my question is how do I get the edited info to update the excel spreadheet? Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi

Try This on a copy of your sheet. Place it on a command button or in an event for your text box. I have commented to try to make thinks understandable, you will have to alter the code to reflect your criteria.

Code:
Application.ScreenUpdating = False
Dim FXrange, WSR
Set WSR = Sheets("Mysheet").Range("A1:A30") 

                           ' *** Change to Reflect The Nmae of Your Sheet & The Range Where The Part Numbers Are Kept ****

For Each FXrange In WSR '### FXrange Moves Through Each Cell in The WSR Range and Interigates it ###

    If FXrange.Value = MyUserForm.Mymastertextbox.Value Then
           '*** Mymastertextbox is Where The Original Part Number Resides, Change to Reflect The True Name ***
      
    
 FXrange.Offset(0, 3).Value = MyUserForm.myTextBox.Value  

                                 '*** Change The Name of The Form & Text Box to Replact Yours ***
            
   ' *** Change The Offset to reflect Where You Want to Place The Info From the Text Box  Relative to The Part Number ***
  ' *** This Line of Code Can be Repeated & Altered for each Piece of Info in each Text Box on the Form ***

    End If

Next FXrange

regards

Kev
 
Last edited:
Upvote 0
Thanks for replying. Not sure if your code will work or not. I probably should post a sample of my code so you can see how I'm accessing the spreadsheet.

Code:
txtStartQty.Text = WorksheetFunction.VLookup(Cifa, Sheets("Sheet1").Range("A4:F426"), 6, False)
 
Upvote 0
After a closer look at your code, I realized that your code was doing the same thing mine was doing. Copied your code and changed the appropriate names but not having any success in getting it to work.
 
Upvote 0
Hi

are the numbers pure numbers or text & numbers, this doesn't work in it's present state on pure numbers, if you continue to have problems, send me a copy of your sheet containing dummy data, and I can have a closer look.


kevin.eames@airbus.com


regards


Kev
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top