Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Storing textin a variable and comparing to a second value

Not sure if I'm going about this right.
I need to go compare text (a name) in a cell with text (a name) in another
cell.

After that I do some stuff, which I should be able to handle. I just can't
figure the VBA syntax to do that. It will be part of a larger macro.

New to VBA and can't seem to find a web site that helps.

Ron
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Storing textin a variable and comparing to a second value

hi
a little sketchy on details but
try this..
Sub Matchit()
If Range("A2").Value = Range("C2").Value Then
MsgBox "match"
Else
MsgBox "no match"
End If
End Sub

regards
FSt1

"Ron" wrote:

Not sure if I'm going about this right.
I need to go compare text (a name) in a cell with text (a name) in another
cell.

After that I do some stuff, which I should be able to handle. I just can't
figure the VBA syntax to do that. It will be part of a larger macro.

New to VBA and can't seem to find a web site that helps.

Ron

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Storing textin a variable and comparing to a second value

Thanks very much. It was the
If Range("A2").Value = Range("C2").Value Then
syntax I couldn't figure out.

Ron

"FSt1" wrote:

hi
a little sketchy on details but
try this..
Sub Matchit()
If Range("A2").Value = Range("C2").Value Then
MsgBox "match"
Else
MsgBox "no match"
End If
End Sub

regards
FSt1

"Ron" wrote:

Not sure if I'm going about this right.
I need to go compare text (a name) in a cell with text (a name) in another
cell.

After that I do some stuff, which I should be able to handle. I just can't
figure the VBA syntax to do that. It will be part of a larger macro.

New to VBA and can't seem to find a web site that helps.

Ron

  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Storing textin a variable and comparing to a second value

Ok, ok, I'm stuck again. The test worked, but after the test, I need to
increment both A2 and C2 by 8 and run it again. (a10 & c10)

I can't figure out how to store it and then increment it. If I use
relatives and offset, how do I compare the two cells again?

Sub Matchit()
If Range("A2").Value = Range("C2").Value Then
Increment a2 to a10 and c2 to c10 and run it again.
Else
Insert 8 blank lines, moving c2 down to c10 and test again. (I think I
can do this as I did it in a macro)
End If
End Sub

Thanks for the help.

Ron

"Ron" wrote:

Thanks very much. It was the
If Range("A2").Value = Range("C2").Value Then
syntax I couldn't figure out.

Ron

"FSt1" wrote:

hi
a little sketchy on details but
try this..
Sub Matchit()
If Range("A2").Value = Range("C2").Value Then
MsgBox "match"
Else
MsgBox "no match"
End If
End Sub

regards
FSt1

"Ron" wrote:

Not sure if I'm going about this right.
I need to go compare text (a name) in a cell with text (a name) in another
cell.

After that I do some stuff, which I should be able to handle. I just can't
figure the VBA syntax to do that. It will be part of a larger macro.

New to VBA and can't seem to find a web site that helps.

Ron

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
Storing a range variable in a cell Dreaded404 Excel Discussion (Misc queries) 1 July 2nd 08 03:37 PM
Storing a value to variable CLamar Excel Discussion (Misc queries) 0 June 16th 06 04:46 PM
storing data JK57 Excel Worksheet Functions 3 May 1st 06 12:16 AM
Storing Formulas to Use NEWB Excel Worksheet Functions 3 December 2nd 05 05:23 PM
Storing Values dinesh Excel Discussion (Misc queries) 0 June 10th 05 06:33 AM


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