This is a data source.
What I am trying to do is to:
- Add 9000 in each empty cell in column D
- Concatenate column D and E in column B e.g
C2&"-"&D2
- Add column E and F in column G
For this, I wrote code which first checks cell D2, if it is empty
then add 9000. Then it concatenates D2 and E2 (C2&"-"&D2
) in B2. Then adds values of E2 and F2 in G2. Then it goes to next row and select D3 and check if it is empty
. Code lopes over 6000 rows. Here is the code:
Range("D2").Select
For Count = 1 To (CellsCount - 1)
If IsEmpty(ActiveCell) Then ActiveCell.Value = 9000
ActiveCell.Offset(0, -2).Select
ActiveCell = Cells(1 + Count, 3) & "-" & Cells(1 + Count, 4)
ActiveCell.Offset(0, 5).Select
ActiveCell = Cells(1 + Count, 5) + Cells(1 + Count, 6)
ActiveCell.Offset(1, -3).Select
Next Count
It takes approximately 10 minutes for code to run. Would appreciate if you can suggest me a faster way to run the code.
Thanks