JP2R
New Member
I have a bunch of data that I'm trying to format, combine data, and strip out unnecessary items.
I created several functions that I have been copying/pasting across these spreadsheets which got me to thinking that perhaps I could convert the function into VBA
-
I saw somewhere that I could use "F2" key while recording a macro that would add the function.
The test result looks something like this:
Range("C2").Select
ActiveCell.FormulaR1C1 = "=IFERROR(MID(RC1,FIND(""/"",RC[-2],22)-1,1),"""")"
Range("C2").Select
Which was cool, but I would like this to fill down the column, again that would mean more copy/paste, so I wondered about how to find the last row.
I searched and found this suggestion:
Dim LastRow As Long
With ActiveSheet.UsedRange
LastRow = .Rows(.Rows.Count).Row
End With
MsgBox LastRow
but I can't figure out how to write the two together to find the last used row and then fill the function all the way down.
Might someone be able to help?
-- Jae
I created several functions that I have been copying/pasting across these spreadsheets which got me to thinking that perhaps I could convert the function into VBA
-
I saw somewhere that I could use "F2" key while recording a macro that would add the function.
The test result looks something like this:
Range("C2").Select
ActiveCell.FormulaR1C1 = "=IFERROR(MID(RC1,FIND(""/"",RC[-2],22)-1,1),"""")"
Range("C2").Select
Which was cool, but I would like this to fill down the column, again that would mean more copy/paste, so I wondered about how to find the last row.
I searched and found this suggestion:
Dim LastRow As Long
With ActiveSheet.UsedRange
LastRow = .Rows(.Rows.Count).Row
End With
MsgBox LastRow
but I can't figure out how to write the two together to find the last used row and then fill the function all the way down.
Might someone be able to help?
-- Jae