ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Re-Populate User Forms (https://www.excelbanter.com/excel-programming/357340-re-populate-user-forms.html)

Sam2

Re-Populate User Forms
 

Hi,

I'm using a user form for users to select data, then once finished its
populated on an excel spreadsheet, i have no problems with part, but my
question is if the users need to change any part of the historical data,
which is assigned a task number how do i repopulate the user form with
that particular task information? Once they are happy the data is
re-applied to the same row?

Any help would be appreciated..


--
Sam2
------------------------------------------------------------------------
Sam2's Profile: http://www.excelforum.com/member.php...o&userid=32899
View this thread: http://www.excelforum.com/showthread...hreadid=527131


Toppers

Re-Populate User Forms
 
Use MATCH:

Dim res as variant

res=Application.match(<TaskiD,<ListTaskIDs,0)
If iserror(res) then
Msgbox <Taskid & "not found"
else
' get data
res=<row number
textbox1.value=worksheets("Data").cells(res,"C")
....
.....
end if

Where
<Taskid is task id to match on
<ListTaskIds is list of task iDs e.g. named range (starting at row 1
...A1:A200 so res returns correct row number)

HTh

"Sam2" wrote:


Hi,

I'm using a user form for users to select data, then once finished its
populated on an excel spreadsheet, i have no problems with part, but my
question is if the users need to change any part of the historical data,
which is assigned a task number how do i repopulate the user form with
that particular task information? Once they are happy the data is
re-applied to the same row?

Any help would be appreciated..


--
Sam2
------------------------------------------------------------------------
Sam2's Profile: http://www.excelforum.com/member.php...o&userid=32899
View this thread: http://www.excelforum.com/showthread...hreadid=527131




All times are GMT +1. The time now is 01:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com