ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   F=$100, G=$-100, cut rows & paste in new sheet (https://www.excelbanter.com/excel-programming/354767-f%3D%24100-g%3D%24-100-cut-rows-paste-new-sheet.html)

kent

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?

R..VENKATARAMAN

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?




Kent

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?






All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com