Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Text Box Link

Hi Everyone

I have a UserForm with several Text Boxes that are filled by reading data
from "Sheet1". TBox1 has a unique part number from column "K" of "Sheet1" Is
it possible for TBox1 to read "Sheet2" find the same number in column "K" of
"Sheet2" then insert the name of the part number that is in Column "A" (on
the same row in "Sheet2") into Text Box2 on the UserForm. I can then add all
the data in the Text Boxes to "Sheet3"

--
Many thanks

hazel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Box Link

Dim rng as Range, s as Variant
Dim rng1 as Range, res as Variant
With worksheets(Sheet2")
set rng = .range(.cells(2,"K"),.cells(2,"K").end(xldown))
s = tbox1.Value
if isNumeric(s) then _
s = clng(s)
res = Application.Match(s,rng,0)
if not iserror(res) then
set rng1 = .Cells(rng(res).row,1)
tbox2.Value = rng1.value
else
tbox2.Value = "Part Not found"
end if
end With

--
Regards,
Tom Ogilvy


"Hazel" wrote:

Hi Everyone

I have a UserForm with several Text Boxes that are filled by reading data
from "Sheet1". TBox1 has a unique part number from column "K" of "Sheet1" Is
it possible for TBox1 to read "Sheet2" find the same number in column "K" of
"Sheet2" then insert the name of the part number that is in Column "A" (on
the same row in "Sheet2") into Text Box2 on the UserForm. I can then add all
the data in the Text Boxes to "Sheet3"

--
Many thanks

hazel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Text Box Link

Hi Tom

Thanks for the response and if I put the part number and part name to start
on row 2 it drops in to place in TB2 and transfers OK in to "Sheet3" however
we have 7 rows of information separated by a couple of blank rows, the actual
data begins on row 9 on "Sheet2". I have been trying for ages to get it to
work changing ranges and rows all I seem to get is Part Not Found except when
inserting the data on row2. Are the blank rows stopping the event from
running?? have tried deleting the rows still to no avail. I'm stumped and
tired
--
Many thanks

hazel


"Tom Ogilvy" wrote:

Dim rng as Range, s as Variant
Dim rng1 as Range, res as Variant
With worksheets(Sheet2")
set rng = .range(.cells(2,"K"),.cells(2,"K").end(xldown))
s = tbox1.Value
if isNumeric(s) then _
s = clng(s)
res = Application.Match(s,rng,0)
if not iserror(res) then
set rng1 = .Cells(rng(res).row,1)
tbox2.Value = rng1.value
else
tbox2.Value = "Part Not found"
end if
end With

--
Regards,
Tom Ogilvy


"Hazel" wrote:

Hi Everyone

I have a UserForm with several Text Boxes that are filled by reading data
from "Sheet1". TBox1 has a unique part number from column "K" of "Sheet1" Is
it possible for TBox1 to read "Sheet2" find the same number in column "K" of
"Sheet2" then insert the name of the part number that is in Column "A" (on
the same row in "Sheet2") into Text Box2 on the UserForm. I can then add all
the data in the Text Boxes to "Sheet3"

--
Many thanks

hazel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Text Box Link



"Hazel" wrote:

Hi Tom

Thanks for the response and if I put the part number and part name to start
on row 2 it drops in to place in TB2 and transfers OK in to "Sheet3" however
we have 7 rows of information separated by a couple of blank rows, the actual
data begins on row 9 on "Sheet2". I have been trying for ages to get it to
work changing ranges and rows all I seem to get is Part Not Found except when
inserting the data on row2. Are the blank rows stopping the event from
running?? have tried deleting the rows still to no avail. I'm stumped and
tired
--
Many thanks

hazel


"Tom Ogilvy" wrote:

Dim rng as Range, s as Variant
Dim rng1 as Range, res as Variant
With worksheets(Sheet2")
set rng = .range(.cells(2,"K"),.cells(2,"K").end(xldown))
s = tbox1.Value
if isNumeric(s) then _
s = clng(s)
res = Application.Match(s,rng,0)
if not iserror(res) then
set rng1 = .Cells(rng(res).row,1)
tbox2.Value = rng1.value
else
tbox2.Value = "Part Not found"
end if
end With

--
Regards,
Tom Ogilvy


"Hazel" wrote:

Hi Everyone

I have a UserForm with several Text Boxes that are filled by reading data
from "Sheet1". TBox1 has a unique part number from column "K" of "Sheet1" Is
it possible for TBox1 to read "Sheet2" find the same number in column "K" of
"Sheet2" then insert the name of the part number that is in Column "A" (on
the same row in "Sheet2") into Text Box2 on the UserForm. I can then add all
the data in the Text Boxes to "Sheet3"

--
Many thanks

hazel

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link in Text box Randy Blake Charts and Charting in Excel 0 October 19th 09 06:41 PM
link text AM Excel Worksheet Functions 1 October 8th 07 02:49 PM
Link to text and return text into a formula? Mary Excel Worksheet Functions 5 June 22nd 07 01:49 PM
Can you link text from one worksheet to another? KlipschPM Excel Worksheet Functions 1 January 23rd 07 08:45 PM
I want to link, not just copy,Word source text to a text box in Ex Carrie K Excel Worksheet Functions 0 August 12th 05 07:58 PM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"