Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
RANGE MACRO
I am trying to compare two ranges of data. if those ranges are the same i
would like to delete one of them because it is a dup. How do i do this in macros. what would be the syntax. i tried: Range("A3:E3").Select ActiveWorkbook.Names.Add Name:="RANGE1", RefersToR1C1:=Selection Range("A4:E4").Select ActiveWorkbook.Names.Add Name:="RANGE2", RefersToR1C1:=Selection If Range("RANGE1") = Range("RANGE2") Then Range("RANGE2").Delete |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
RANGE MACRO
Since Range1 is cells A3 - E3 and Range2 is cells A4 - E4 the 2 ranges are
different. Did you want to know if they contain the identical values. If so then do they have to occure in the same order? Do the formats have to be the same? Do you really want to delete the range or just clear the contents??? -- HTH... Jim Thomlinson "Joseph Weber" wrote: I am trying to compare two ranges of data. if those ranges are the same i would like to delete one of them because it is a dup. How do i do this in macros. what would be the syntax. i tried: Range("A3:E3").Select ActiveWorkbook.Names.Add Name:="RANGE1", RefersToR1C1:=Selection Range("A4:E4").Select ActiveWorkbook.Names.Add Name:="RANGE2", RefersToR1C1:=Selection If Range("RANGE1") = Range("RANGE2") Then Range("RANGE2").Delete |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
RANGE MACRO
DAN NOVOTNAK 01/17/2008 26,739 $26.01
DAN NOVOTNAK 01/17/2008 26,739 $26.01 The project i am working on is an expense report for gas usage. I have been getting copies of certain expense reports and i need a way to delet the line that is a duplicate. So basically if one line equals the next then delete one of them. I found this to be pretty easy when I have to pay suppliers because there is an invoice and all i need to do is compare one cell with another. The first line would have to exactly match the second line and yes i want to delete it because i am doing this manually now and it is killing my eyes "Jim Thomlinson" wrote: Since Range1 is cells A3 - E3 and Range2 is cells A4 - E4 the 2 ranges are different. Did you want to know if they contain the identical values. If so then do they have to occure in the same order? Do the formats have to be the same? Do you really want to delete the range or just clear the contents??? -- HTH... Jim Thomlinson "Joseph Weber" wrote: I am trying to compare two ranges of data. if those ranges are the same i would like to delete one of them because it is a dup. How do i do this in macros. what would be the syntax. i tried: Range("A3:E3").Select ActiveWorkbook.Names.Add Name:="RANGE1", RefersToR1C1:=Selection Range("A4:E4").Select ActiveWorkbook.Names.Add Name:="RANGE2", RefersToR1C1:=Selection If Range("RANGE1") = Range("RANGE2") Then Range("RANGE2").Delete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro deletes row in range, macro then skips the row moved up | Excel Discussion (Misc queries) | |||
Macro to copy a specified range to a variable range | Excel Programming | |||
Macro won't execute when "For Each 'range' in 'range'" is added | Excel Programming | |||
Set Range in one macro to range in another | Excel Programming | |||
Macro to input formula in range based on another range | Excel Programming |