Hi, Mukesh
there is a lot of unnecessary movement in the code, and I pretty much doubt that you know what you are putting down as comment should be put down in the code as well:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vTemp As Variant
Dim var As Variant
Dim lngArr As Long
If Target.Row < 7 Then Exit Sub
Application.EnableEvents = False
'CONCATENATE column g
var = Array("C", "d", "e", "f")
For lngArr = LBound(var) To UBound(var)
vTemp = vTemp & Cells(Target.Row, var(lngArr)).Value & " "
Next lngArr
vTemp = Replace(Trim(vTemp), "-", " ")
Cells(Target.Row, "G").Value = vTemp
'CONCATENATE column ac
var = Array("z", "aa", "ab")
For lngArr = LBound(var) To UBound(var)
vTemp = vTemp & Cells(Target.Row, var(lngArr)).Value & " "
Next lngArr
vTemp = Replace(Trim(vTemp), "-", " ")
Cells(Target.Row, "ac").Value = vTemp
'CONCATENATE column ad
var = Array("aa", "ab")
For lngArr = LBound(var) To UBound(var)
vTemp = vTemp & Cells(Target.Row, var(lngArr)).Value & " "
Next lngArr
vTemp = Replace(Trim(vTemp), "-", " ")
Cells(Target.Row, "ad").Value = vTemp
Application.EnableEvents = True
End Sub
I didn't understand the second suggestion of break point using f9. Please explain it little more for me for better understanding. On which line the break point should be place?
Put the cursor into the first executable line of code and press F9, from my sample this would be the line
If Target.Row < 7 Then Exit Sub
If the code is fired it will hold on that line and you can step through the rest of the code by pressing F8.
Ciao,
Holger
Bookmarks