I know I'm going to smack my forehead when someone points out how easy it is, but essentially, I'm looking for the opposite of this:
Here, when a cell is selected, I use this to get the number of the row that it is in. As you can see below, this code searches for a particular field, then deletes that whole row and adds 2 blank rows in it's place. I end up with a row selected and want to get that row number, go to cell(currentrownumber, "F") and do an autosum. But I can't find the specific function to do this. Any help please? VERY much appreciated.
Dim rngFind As Range
Dim currentrow As Integer
Dim currentcol As Integer
currentrow = ActiveCell.Row
currentcol = ActiveCell.Column
With Range(Selection, Selection.End(xlDown))
Do
Set rngFind = .Find(What:="#Item Number", After:=.Cells(1, 1), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If rngFind Is Nothing Then Exit Do
rngFind.EntireRow.Select
Selection.Delete Shift:=x1up
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
' MAGIC CODE
' Cells(MAGICCODE, "F").Select
' Application.SendKeys ("%=~")
Loop
End With
[/QUOTE]
Bookmarks