Good afternoon,
I been having trouble with absoluting the columns in my macro. I just dont know how to make it to work until the very last row of the column. I use the recording macro. but after several months my data grew so large then not all of the rows were absoluted. How do I change this macro to start from last row then work its way up in a column to absolute the values. The issue is the rows can go beyond 200,000 rows, so the 165k wont work. Any assistance is greatly appreciated.
this find last row in column A
Sub aa() Dim lastrow As Long lastrow = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row Cells(lastrow, 1).Select End Sub
Regards
tom1977
If You are satisfied with my solution click the small star icon on the left to say thanks.
Thanks Tom. I will try, do I specify the last row in column F in that code? Because there will be other columns that will not have any data on the specifics rows. So I should type
[code]
Sub aa()
Dim lastrow As Long
lastrow = Worksheets("Sheet1").Cells(Rows.Count, 6).End(xlUp).Row
Cells(lastrow, 6).Select
End Sub
[\code]
correct?
Last edited by preciouslife73; 01-14-2012 at 04:00 PM.
yes that is ok but if you do not want use the numbers of columns you can use this
Sub aa() Dim lastrow As Long lastrow = Worksheets("sheet1").Cells(Rows.Count, "f").End(xlUp).Row Range("f" & lastrow).Select End Sub
Regards
tom1977
If You are satisfied with my solution click the small star icon on the left to say thanks.
Thanks! I appreciated it.
Actually it didn't work because when I tried to auto fill the absolute value from the beginning of the column
It started at the last row. How do I make it work to start from top to last row auto fill? Below is the code:
lastrow = Worksheets("Unmatched_Transactions").Cells(Rows.Count,
"G").End(xlUp).Row
***Columns("G:G").Select
***Selection.Insert Shift:=xlToRight
***Range("G2").Select
***ActiveCell.FormulaR1C1 = "=ABS(RC[1])"
***Range("G2").Select
***Selection.AutoFill Destination:=Range("G" & lastrow).Select
check this
Sub aa() Dim lastrow As Long lastrow = Worksheets("Unmatched_Transactions").Cells(Rows.Count, "G").End(xlUp).Row Columns("G:G").Insert Shift:=xlToRight Range("G2").FormulaR1C1 = "=ABS(RC[1])" Range("G2:g" & lastrow).FillDown End Sub
Regards
tom1977
If You are satisfied with my solution click the small star icon on the left to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks