Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


In the original version of my quote module I was using the INDEX/MATCH
formula below in combination with a drop down box to populate several
other cells. I am now working in a multi-page user form, and I would to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


Above I stated that it was 3 text boxes would need the formula. Actuall
two will use the INDEX/MATCH, and one will use a simple cell*cell*cel
formula. I also need help with that one, but I assume the answer wil
be much simpler

--
Amber_D_Law
-----------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...fo&userid=3001
View this thread: http://www.excelforum.com/showthread.php?threadid=51331

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default INDEX/MATCH formula in VBA to populate text boxes

res = Application.INDEX(Range("Catalog Listings!$B$3:$D$223"), _
Application.MATCH(Combobox1.Value, Range( _
"Catalog Listings!$B$3:$B$223"),0),1)

Textbox1.Value = res

--
Regards,
Tom Ogilvy



"Amber_D_Laws"
wrote in message
news:Amber_D_Laws.23c4wm_1140115201.9149@excelforu m-nospam.com...

In the original version of my quote module I was using the INDEX/MATCH
formula below in combination with a drop down box to populate several
other cells. I am now working in a multi-page user form, and I would to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


Great! However, I need to how to define the varible "res"


Tom Ogilvy Wrote:
res = Application.INDEX(Range("Catalog Listings!$B$3:$D$223"), _
Application.MATCH(Combobox1.Value, Range( _
"Catalog Listings!$B$3:$B$223"),0),1)

Textbox1.Value = res

--
Regards,
Tom Ogilvy



"Amber_D_Laws"

wrote in message
news:Amber_D_Laws.23c4wm_1140115201.9149@excelforu m-nospam.com...

In the original version of my quote module I was using the

INDEX/MATCH
formula below in combination with a drop down box to populate

several
other cells. I am now working in a multi-page user form, and I would

to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default INDEX/MATCH formula in VBA to populate text boxes

Amber,
I tried Tom's code (on Eric's "problem" that you replied to)
and it worked fine so this suggests a typo on your part.

Res will default to variant if you don't DIM it ( and I didn't).

"Amber_D_Laws" wrote:


I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default INDEX/MATCH formula in VBA to populate text boxes

It was the spaces in names that was the problem - at least it worked when I
adjusted for that. If I had used

Worksheets("Catalog Listings").Range("B3:D223")

it would have been fine. But apparently when thrown into a range argument
as a single string, it needs the single quotes.

--
Regards,
Tom Ogilvy


"Toppers" wrote in message
...
Amber,
I tried Tom's code (on Eric's "problem" that you replied

to)
and it worked fine so this suggests a typo on your part.

Res will default to variant if you don't DIM it ( and I didn't).

"Amber_D_Laws" wrote:


I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


Toppers...long time no see!
I'm glad to know that the code worked, and that I could help Eric; even
if by proxy.

See ya' around,
Amber


Toppers Wrote:
Amber,
I tried Tom's code (on Eric's "problem" that you replied to)
and it worked fine so this suggests a typo on your part.

Res will default to variant if you don't DIM it ( and I didn't).

"Amber_D_Laws" wrote:


I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312




--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default INDEX/MATCH formula in VBA to populate text boxes

Private Sub ComboBox1_Click()
Dim res As Variant
res = Application.Index(Range("'Catalog Listings'!$B$3:$D$223"), _
Application.Match(ComboBox1.Value, Range( _
"'Catalog Listings'!$B$3:$B$223"), 0), 2)
TextBox1.Value = res
End Sub


worked fine for me. (guess you need the single quotes for the range
argument)

--
Regards,
Tom Ogilvy


"Amber_D_Laws"
wrote in message
news:Amber_D_Laws.23c7om_1140118802.9768@excelforu m-nospam.com...

I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


Well, there you go. I just realized what you meant about the single
quotes. I put them in and it works like a dream! Thanks again Tom, you
are a life saver as usual!

Tom Ogilvy Wrote:
Private Sub ComboBox1_Click()
Dim res As Variant
res = Application.Index(Range("'Catalog Listings'!$B$3:$D$223"), _
Application.Match(ComboBox1.Value, Range( _
"'Catalog Listings'!$B$3:$B$223"), 0), 2)
TextBox1.Value = res
End Sub


worked fine for me. (guess you need the single quotes for the range
argument)

--
Regards,
Tom Ogilvy


"Amber_D_Laws"

wrote in message
news:Amber_D_Laws.23c7om_1140118802.9768@excelforu m-nospam.com...

I tried defining as:

Dim res As String
and
Dim res As Variant

both return the following error:

"Run-time error '1004':
Method 'Range' of object '_Global' failed

I'm I doing something wrong, or does the code contain a typo?

Amber :)

Amber_D_Laws Wrote:
Great! However, I need to how to define the varible "res"



--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default INDEX/MATCH formula in VBA to populate text boxes

dim res as variant

Amber_D_Laws wrote:

Great! However, I need to how to define the varible "res"

Tom Ogilvy Wrote:
res = Application.INDEX(Range("Catalog Listings!$B$3:$D$223"), _
Application.MATCH(Combobox1.Value, Range( _
"Catalog Listings!$B$3:$B$223"),0),1)

Textbox1.Value = res

--
Regards,
Tom Ogilvy



"Amber_D_Laws"

wrote in message
news:Amber_D_Laws.23c4wm_1140115201.9149@excelforu m-nospam.com...

In the original version of my quote module I was using the

INDEX/MATCH
formula below in combination with a drop down box to populate

several
other cells. I am now working in a multi-page user form, and I would

to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312


--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312


--

Dave Peterson
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default INDEX/MATCH formula in VBA to populate text boxes

And I might replace:
Textbox1.Value = res
with:

if iserror(res) then
textbox1.value = "No match" 'or whatever you want to see
else
textbox1.value = res
end if




Dave Peterson wrote:

dim res as variant

Amber_D_Laws wrote:

Great! However, I need to how to define the varible "res"

Tom Ogilvy Wrote:
res = Application.INDEX(Range("Catalog Listings!$B$3:$D$223"), _
Application.MATCH(Combobox1.Value, Range( _
"Catalog Listings!$B$3:$B$223"),0),1)

Textbox1.Value = res

--
Regards,
Tom Ogilvy



"Amber_D_Laws"

wrote in message
news:Amber_D_Laws.23c4wm_1140115201.9149@excelforu m-nospam.com...

In the original version of my quote module I was using the
INDEX/MATCH
formula below in combination with a drop down box to populate
several
other cells. I am now working in a multi-page user form, and I would
to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:
http://www.excelforum.com/member.php...o&userid=30012
View this thread:
http://www.excelforum.com/showthread...hreadid=513312


--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312


--

Dave Peterson


--

Dave Peterson
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


Great Idea Dave!!
I will incorporate this into the code. ;)



Dave Peterson Wrote:
And I might replace:
Textbox1.Value = res
with:

if iserror(res) then
textbox1.value = "No match" 'or whatever you want to see
else
textbox1.value = res
end if




Dave Peterson wrote:

dim res as variant

Amber_D_Laws wrote:

Great! However, I need to how to define the varible "res"

Tom Ogilvy Wrote:
res = Application.INDEX(Range("Catalog Listings!$B$3:$D$223"), _
Application.MATCH(Combobox1.Value, Range( _
"Catalog Listings!$B$3:$B$223"),0),1)

Textbox1.Value = res

--
Regards,
Tom Ogilvy



"Amber_D_Laws"

wrote in message

news:Amber_D_Laws.23c4wm_1140115201.9149@excelforu m-nospam.com...

In the original version of my quote module I was using the
INDEX/MATCH
formula below in combination with a drop down box to populate
several
other cells. I am now working in a multi-page user form, and I

would
to
do a similar action with text boxes.

The formula is as follows:
=INDEX('Catalog Listings'!$B$3:$D$223,MATCH(C30,'Catalog
Listings'!$B$3:$B$223,0),1)

So, the question is this. How do I INDEX/MATCH from a comboBox

in a
userform to several different text boxes (3 to be specific)?

As always any advice is appreciated.
Regards,
Amber


--
Amber_D_Laws


------------------------------------------------------------------------
Amber_D_Laws's Profile:
http://www.excelforum.com/member.php...o&userid=30012
View this thread:
http://www.excelforum.com/showthread...hreadid=513312


--
Amber_D_Laws

------------------------------------------------------------------------
Amber_D_Laws's Profile:

http://www.excelforum.com/member.php...o&userid=30012
View this thread:

http://www.excelforum.com/showthread...hreadid=513312

--

Dave Peterson


--

Dave Peterson



--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312

  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default INDEX/MATCH formula in VBA to populate text boxes


*******bump*******


--
Amber_D_Laws
------------------------------------------------------------------------
Amber_D_Laws's Profile: http://www.excelforum.com/member.php...o&userid=30012
View this thread: http://www.excelforum.com/showthread...hreadid=513312

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
index / lookup / match / text formula JB2010 Excel Discussion (Misc queries) 4 March 28th 07 03:01 AM
index / lookup / match / text formula Toppers Excel Discussion (Misc queries) 3 March 28th 07 01:13 AM
index / lookup / match / text formula Toppers Excel Discussion (Misc queries) 0 March 28th 07 12:20 AM
index / lookup / match / text formula JB2010 Excel Discussion (Misc queries) 0 March 28th 07 12:18 AM
Keep text color from a Index Match Formula Woody Excel Programming 4 July 21st 05 05:43 PM


All times are GMT +1. The time now is 08:03 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"