Hi All
I have a report that I run off a database and extract to Excel.
It has 3 fields: Title; FirstName; LastName. For example sake lets say they are in columns A, B, C. Now in D I have a fieldname of FullName and in D2 onwards the formula: =A2&" "&B2&" "&C2.
Now I currently manually type the formula and drag it down to the same row as the last entry in the first 3 columns so that I get the full title in one cell.
I wanted to know how I could enter the the formula above in column D so that it automatically does this for me?
I tried to record a Macro as a test for column D setting the field name in D1 and the formula in D2 and got the following:
Range("D1").FormulaR1C1 = "FullName"
Range("D2").Select
ActiveCell.FormulaR1C1 = "=RC[-7]&"" ""&RC[-6]&"" ""&RC[-5]"
Range("D3").Select
How can I copy this down in a Macro only to the last populated row in columns A, B & C?
I have a piece of code to highlight a range from A2 to the last entry as so:
Range("A2").Select
Range("A2", (Cells(65536, ActiveCell.Column).End(xlUp))).Select
Selection.Copy
How can I use the above code as the range that needs the formula adding in column D as I am worried if I don't measure the range the macro will simply populate until it hits row 65536?
I would be grateful for some guidance.
Thanks.
Bookmarks