Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default using match in vba without assigning a cell

I am trying to use the match function to assign a value to a variable.
I do not want to put the match syntax in a cell. I just want the result to
be able to be referred to later in an If then statement. I have tried:

startbase = Match(begbase, "a:a")
but that does not work.

Any suggestions would be appreciated.
TIA
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default using match in vba without assigning a cell

I am trying this:
sb=application.match(begbase,a2:a20)
and not having any success.
Did I misunderstand?

"Don Guillett" wrote:

to use match

sb=application.match

--
Don Guillett
SalesAid Software

"Papa Jonah" wrote in message
...
I am trying to use the match function to assign a value to a variable.
I do not want to put the match syntax in a cell. I just want the result

to
be able to be referred to later in an If then statement. I have tried:

startbase = Match(begbase, "a:a")
but that does not work.

Any suggestions would be appreciated.
TIA




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default using match in vba without assigning a cell

Papa,

Try:

sb=application.match(begbase,Range("a2:a20"))

HTH,
Bernie
MS Excel MVP


"Papa Jonah" wrote in message
...
I am trying this:
sb=application.match(begbase,a2:a20)
and not having any success.
Did I misunderstand?

"Don Guillett" wrote:

to use match

sb=application.match

--
Don Guillett
SalesAid Software

"Papa Jonah" wrote in message
...
I am trying to use the match function to assign a value to a variable.
I do not want to put the match syntax in a cell. I just want the

result
to
be able to be referred to later in an If then statement. I have

tried:

startbase = Match(begbase, "a:a")
but that does not work.

Any suggestions would be appreciated.
TIA








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default using match in vba without assigning a cell

dim sb as variant

sb = application.match(begbase,worksheets("sheet1").ran ge("a2:a20"))

or for an exact match
sb = application.match(begbase,worksheets("sheet1").ran ge("a2:a20"),0)

Papa Jonah wrote:

I am trying this:
sb=application.match(begbase,a2:a20)
and not having any success.
Did I misunderstand?

"Don Guillett" wrote:

to use match

sb=application.match

--
Don Guillett
SalesAid Software

"Papa Jonah" wrote in message
...
I am trying to use the match function to assign a value to a variable.
I do not want to put the match syntax in a cell. I just want the result

to
be able to be referred to later in an If then statement. I have tried:

startbase = Match(begbase, "a:a")
but that does not work.

Any suggestions would be appreciated.
TIA





--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default using match in vba without assigning a cell

Thanks everyone!

"Dave Peterson" wrote:

dim sb as variant

sb = application.match(begbase,worksheets("sheet1").ran ge("a2:a20"))

or for an exact match
sb = application.match(begbase,worksheets("sheet1").ran ge("a2:a20"),0)

Papa Jonah wrote:

I am trying this:
sb=application.match(begbase,a2:a20)
and not having any success.
Did I misunderstand?

"Don Guillett" wrote:

to use match

sb=application.match

--
Don Guillett
SalesAid Software

"Papa Jonah" wrote in message
...
I am trying to use the match function to assign a value to a variable.
I do not want to put the match syntax in a cell. I just want the result
to
be able to be referred to later in an If then statement. I have tried:

startbase = Match(begbase, "a:a")
but that does not work.

Any suggestions would be appreciated.
TIA




--

Dave Peterson

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
Finding a single word match in a text string and assigning a code Morton Detwyler[_2_] Excel Worksheet Functions 6 September 15th 09 09:18 PM
assigning a value to a cell Braheem Excel Worksheet Functions 3 September 13th 06 04:42 AM
Assigning a value to a cell from a combox sjayar Excel Discussion (Misc queries) 3 November 2nd 05 12:58 PM
Assigning a value to an array cell Srikanth Ganesan[_2_] Excel Programming 1 September 17th 04 03:09 AM
Match / Name-assigning To A Range fabalicious Excel Programming 1 April 8th 04 11:28 AM


All times are GMT +1. The time now is 03:26 PM.

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

About Us

"It's about Microsoft Excel"