Excel/Excel Userform

Advertisement


Question
SnapShot
SnapShot  
Hi Gulshan

I am trying to set-up a user form in excel where users can click on a button which brings up the user form and enter a reference in the "reference text box" then it extracts data from table on one of the sheets and auto populates all the fields in this user form. Now all of the above is working fine and i used vlookup function.  

My issue is that i want the users to be able to amend or add more details to any of those fields and when they hit update button the same cells in the table on my sheet are updated, most can be over written but couple cells i need to info to be added without over writing the existing text.

Below is the coding i used for the "extract" button. by the way "update" is the name of my userform.

Private Sub extract_Click()

update.itssmanager.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 2, 0)
update.idea.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 3, 0)
update.cep.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 8, 0)
update.projectphase.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 9, 0)
update.consultstatus.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 10, 0)
update.notes.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 28, 0)
update.dateflag.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 29, 0)
update.budgetflag.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 30, 0)
update.scopeflag.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 31, 0)
update.gitflag.Value = Application.WorksheetFunction.VLookup(update.ref, Sheets("sample").Range("A2:AF6"), 32, 0)

End Sub

Thanks in advance

Answer
Hello Sunny,

I have worked on something similar before. Can you send me your file with some sample data so I can update the macro to meet your needs and send it back to you.

Please send the mail to gulshanrajpurswani@gmail.com and mention AllExperts in the subject line.

Thanks,
Gulshan.
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


GULSHAN PURSWANI

Expertise

I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.

Experience

I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Education/Credentials
Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2016 About.com. All rights reserved.