Hi,
I am trying to create a new table starting from three others (that are in the 3 previous sheet). I succeeded but unfortunately the resulting table is not keeping the same format. Could you advise please?
I am trying to create a new table starting from three others (that are in the 3 previous sheet). I succeeded but unfortunately the resulting table is not keeping the same format. Could you advise please?
VBA Code:
Set cell_range = Range("A4:Z50")
SheetCount = .Worksheets.Count
If WorksheetFunction.CountA(Cells) <> 0 Then
.Worksheets.Add After:=.Worksheets(SheetCount)
End If
SheetCount = .Worksheets.Count
For Each Cell In cell_range
If IsNumeric(.Worksheets(SheetOne).Range(Cell.Address).Value) Then
.Worksheets(SheetCount).Range(Cell.Address).Value = .Worksheets(SheetThree).Range(Cell.Address).Value + .Worksheets(SheetOne).Range(Cell.Address).Value + .Worksheets(SheetTwo).Range(Cell.Address).Value
Else
.Worksheets(SheetCount).Range(Cell.Address).Value = .Worksheets(SheetThree).Range(Cell.Address).Value
End If
Next Cell
End With