View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
velasques
 
Posts: n/a
Default inserting a conditional "go to" command on a excel "if" functi

Thanks.
....and if the condition is a variable, how do I do?
That is: I have to compare successively two values in a table, beginning
with C1 with C2, then C3 with C4, then C5 with C6, and so on till the end of
the table. If the values are equal nothing to do, but if the values are
different a row must be inserted below of the first cell of that particular
condition with the same value of that cell.
That is what I have:
A B C D E F
1 AB
2 AB
3 CD
4 CD
5 EF
6 GH
7 GH
8 IJ
€¦and that is what I need:
A B C D E F
1 AB
2 AB
3 CD
4 CD
5 EF
6 EF
7 GH
8 GH
Thanks again.

"Gary L Brown" escreveu:

From the Visual Basic Editor put something like the following code.
Obviously, change what the condition is that you are looking for from
'Range("C10").Value = 10' to your particular condition and change the name of
the macro from 'MyMacro' to your macro's name.


'/=========================================/
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("C10").Value = 10 Then
MyMacro
End If
End Sub
'/=========================================/


HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"velasques" wrote:

How do I do if, in a macro, if I want to write a condition that sends the
command pront to a specific routine, if a particular condition is verified?