I've been working on a macro to convert estimates to a usable form, and so far I've been using LastRow for Autofill functions. For example:
That works fine, but I'm having trouble translating that to work with a text to columns bit (just before the above):
I tried
but that just does the first row (2) and not the rest of the range.
I know the way I have it now (I should never get a file with over 500 lines) will work, but I also know it's not the best way. Is there a way to use LastRow with my text to columns?
Code:
'Makes column A a compilation of K, L, M
Range("A2").Value = "=RC[10]&"" ""&RC[11]&"" ""&RC[12]"
Range("A2").Select
LastRow = Range("B" & Rows.Count).End(xlUp).Row - 1
Selection.AutoFill Destination:=Range("A2").Resize(LastRow), Type:=xlFillDefault
That works fine, but I'm having trouble translating that to work with a text to columns bit (just before the above):
Code:
'Text to Columns on column A to remove excess and prettify
Range("A2:A5000").Select
Selection.TextToColumns Destination:=Range("J2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
I tried
Code:
Range("A2").Select
LastRow = Range("B" & Rows.Count).End(xlUp).Row - 1
I know the way I have it now (I should never get a file with over 500 lines) will work, but I also know it's not the best way. Is there a way to use LastRow with my text to columns?