jamesaplant77
New Member
- Joined
- Apr 22, 2015
- Messages
- 16
I am using this VBA to concatenate the contents of cells I2 and D2 into cell J2, one has a special character so I am using this code to ensure that the formatting remains. It works perfectly fine, but I have 836 rows of data in my workbook, so I need to ensure that the code continues until row 836, rater than just row 2 - I am hoping that this is relatively simple!!
Sub fconcat()
Application.ScreenUpdating = False
Sheets("ALL").Select
Range("J2").Value = Range("I2").Value & Range("D2").Value
For i = 1 To Range("I2").Characters.Count
Range("J2").Characters(i, 1).Font.Name = Range("I2").Characters(i, 1).Font.Name
Next
For i = 1 To Range("D2").Characters.Count
Range("J2").Characters(Range("I2").Characters.Count + i, 1).Font.Name = Range("D2").Characters(i, 1).Font.Name
Next
Application.ScreenUpdating = True
End Sub
Sub fconcat()
Application.ScreenUpdating = False
Sheets("ALL").Select
Range("J2").Value = Range("I2").Value & Range("D2").Value
For i = 1 To Range("I2").Characters.Count
Range("J2").Characters(i, 1).Font.Name = Range("I2").Characters(i, 1).Font.Name
Next
For i = 1 To Range("D2").Characters.Count
Range("J2").Characters(Range("I2").Characters.Count + i, 1).Font.Name = Range("D2").Characters(i, 1).Font.Name
Next
Application.ScreenUpdating = True
End Sub