Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
F=$100, G=$-100, cut rows & paste in new sheet
I have a sheet that i need to be able to compare data in two columns (F:G) I need to identify cells that are equal but opposite. For Example where F50=100 and G106=-100 When a match like this occurs, I need to have the entire rows cut from the present sheet and pasted to a new sheet "Net" I would think that i should be able to start at f1 and search G:G for (f1*-1), then move to f2 and do the same, cut and pasting when applicable. I amn not very good with macro formula's Any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
F=$100, G=$-100, cut rows & paste in new sheet
try this sub
Public Sub test() Worksheets("sheet2").Activate Dim v As Double v = Worksheets("sheet1").Range("f1") With Worksheets("sheet2").Columns("g:g") ..Find(v * -1).Activate End With MsgBox ActiveCell MsgBox ActiveSheet.Name & " " & ActiveCell.Address End Sub "Kent" wrote in message ... I have a sheet that i need to be able to compare data in two columns (F:G) I need to identify cells that are equal but opposite. For Example where F50=100 and G106=-100 When a match like this occurs, I need to have the entire rows cut from the present sheet and pasted to a new sheet "Net" I would think that i should be able to start at f1 and search G:G for (f1*-1), then move to f2 and do the same, cut and pasting when applicable. I amn not very good with macro formula's Any suggestions? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
F=$100, G=$-100, cut rows & paste in new sheet
There seems to be an error with the
...Find(v * -1).Activate line. Any suggestions? "R..VENKATARAMAN" wrote: try this sub Public Sub test() Worksheets("sheet2").Activate Dim v As Double v = Worksheets("sheet1").Range("f1") With Worksheets("sheet2").Columns("g:g") ..Find(v * -1).Activate End With MsgBox ActiveCell MsgBox ActiveSheet.Name & " " & ActiveCell.Address End Sub "Kent" wrote in message ... I have a sheet that i need to be able to compare data in two columns (F:G) I need to identify cells that are equal but opposite. For Example where F50=100 and G106=-100 When a match like this occurs, I need to have the entire rows cut from the present sheet and pasted to a new sheet "Net" I would think that i should be able to start at f1 and search G:G for (f1*-1), then move to f2 and do the same, cut and pasting when applicable. I amn not very good with macro formula's Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
paste data in different sheet but skip rows. | Excel Discussion (Misc queries) | |||
How can copy only the unhide rows and paste it another sheet | Excel Discussion (Misc queries) | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
paste excel sheet excluding hidden rows | Excel Discussion (Misc queries) | |||
Copy rows untill blank row then paste into new sheet | Excel Programming |