Dear all,
I am a fresh VBA learner. The code written was so straightforward. Please help to point out the following how to rewrite again in order to run it faster.
By using data of the upper previous row when the current specific's row cell has value. Copy specific cells and paste them to same column current row cells.
I don't know how to write the code to copy the cell from 1 to 9 (without 3 to 6) in the same row from previous upper row and paste 1 to 9 (without 3 to 6) in the current row.
Thank a lot.
Linda Lo
I am a fresh VBA learner. The code written was so straightforward. Please help to point out the following how to rewrite again in order to run it faster.
VBA Code:
Dim i As Integer
For i = 1 To 10000
If Cells(i, 11) > 0 And Cells(i, 1) = "" Then
Cells(i, 1).Select
Selection.End(xlUp).Select
Selection.Copy
Cells(i, 1).Select
ActiveSheet.Paste
Else
End If
Next i
Dim j As Integer
For j = 1 To 10000
If Cells(j, 11) > 0 And Cells(j, 2) = "" Then
Cells(j, 2).Select
Selection.End(xlUp).Select
Selection.Copy
Cells(j, 2).Select
ActiveSheet.Paste
Else
End If
Next j
Dim k As Integer
For k = 1 To 10000
If Cells(k, 11) > 0 And Cells(k, 7) = "" Then
Cells(k, 7).Select
Selection.End(xlUp).Select
Selection.Copy
Cells(k, 7).Select
ActiveSheet.Paste
Else
End If
Next k
Dim m As Integer
For m = 1 To 10000
If Cells(m, 11) > 0 And Cells(m, 8) = "" Then
Cells(m, 8).Select
Selection.End(xlUp).Select
Selection.Copy
Cells(m, 8).Select
ActiveSheet.Paste
Else
End If
Next m
Dim n As Integer
For n = 1 To 10000
If Cells(n, 11) > 0 And Cells(n, 9) = "" Then
Cells(n, 9).Select
Selection.End(xlUp).Select
Selection.Copy
Cells(n, 9).Select
ActiveSheet.Paste
Else
End If
Next n
I don't know how to write the code to copy the cell from 1 to 9 (without 3 to 6) in the same row from previous upper row and paste 1 to 9 (without 3 to 6) in the current row.
Thank a lot.
Linda Lo