Hi all,
Could anyone help me clean this code up a little. It basically cycles through my sheets and pulls out data from certain cells.and puts it in the actions sheet.
Sub TransferData()
Dim i As Long: i = 6
For Each sh In Worksheets
If sh.Name <> "Actions" Then
Worksheets("Actions").Range("B" & i).Value = sh.Range("A2").Value
Worksheets("Actions").Range("C" & i).Value = sh.Range("B2").Value
i = i + 1
End If
Next sh
End Sub
However, I would like to add somthing like this in which will clear whatever is in the cells in actions already...
Range("B3:G500").Select
Selection.ClearContents
Sadly I'm very bad with VB and have no idea where to put it (if it is even the correct thing to do) without it wiping before it goes through the next sheet. Also I would really like to put a horizontal line under each entry from say B to G. Any help would be reaaaaally appreciated!
Jose
Could anyone help me clean this code up a little. It basically cycles through my sheets and pulls out data from certain cells.and puts it in the actions sheet.
Sub TransferData()
Dim i As Long: i = 6
For Each sh In Worksheets
If sh.Name <> "Actions" Then
Worksheets("Actions").Range("B" & i).Value = sh.Range("A2").Value
Worksheets("Actions").Range("C" & i).Value = sh.Range("B2").Value
i = i + 1
End If
Next sh
End Sub
However, I would like to add somthing like this in which will clear whatever is in the cells in actions already...
Range("B3:G500").Select
Selection.ClearContents
Sadly I'm very bad with VB and have no idea where to put it (if it is even the correct thing to do) without it wiping before it goes through the next sheet. Also I would really like to put a horizontal line under each entry from say B to G. Any help would be reaaaaally appreciated!
Jose