Hi,
I got this vba codes that return values from different sheets (IWKA_PLAN, ADL_PLAN) to main sheet (Gannt). The problem is that when I run one macro it's ok, I get results from specified sheet. But when I start next results replace of previous macro. I'd like to have them below. The amount of results will be changed every day. In future there are about to be more sheets I'll take data from. Also that macros can be run in different order.
The best would also be if data from different separated by border.
So far it looks like that.
http://asset-9.soup.io/asset/6671/2313_9f32.xlsm
I got this vba codes that return values from different sheets (IWKA_PLAN, ADL_PLAN) to main sheet (Gannt). The problem is that when I run one macro it's ok, I get results from specified sheet. But when I start next results replace of previous macro. I'd like to have them below. The amount of results will be changed every day. In future there are about to be more sheets I'll take data from. Also that macros can be run in different order.
The best would also be if data from different separated by border.
So far it looks like that.
Code:
Sub Gantt()
With Sheets("Gantt")
Application.ScreenUpdating = False
lastrow2 = Worksheets("IWKA_PLAN").Range("C48576").End(xlUp).Row
'lastrow3 = Worksheets("ADL_PLAN").Range("C48576").End(xlUp).Row
.Range("C4:C" & lastrow2 + 1).Value = Worksheets("IWKA_PLAN").Range("A3:A" & lastrow2).Value
.Range("H4:H" & lastrow2 + 1).Value = Worksheets("IWKA_PLAN").Range("D3:D" & lastrow2).Value
.Range("I4:I" & lastrow2 + 1).Value = Worksheets("IWKA_PLAN").Range("H3:H" & lastrow2).Value
lastrow1 = Sheets("Gantt").Range("C48576").End(xlUp).Row
'.Cells(lastrow1 + 1, 3).Value = Worksheets("NTS_PLAN").Range("A3:A" & lastrow3 + lastrow3).Value
'.Cells(lastrow1 + 1, 8).Value = Worksheets("NTS_PLAN").Range("D3:D" & lastrow3 + lastrow3).Value
'.Cells(lastrow1 + 1, 9).Value = Worksheets("NTS_PLAN").Range("H3:H" & lastrow3 + lastrow3).Value
'Worksheets("Gantt").Range("I4:I" & lastrow1 + 1).Value = Worksheets("NTS_PLAN").Range("H3:H" & lastrow3).Value
End With
Application.ScreenUpdating = True
End Sub
Sub gannt2()
Application.ScreenUpdating = False
lastrow3 = Worksheets("ADL_PLAN").Range("C48576").End(xlUp).Row
With Sheets("Gantt")
lastrow5 = Sheets("Gantt").Range("C48576").End(xlUp).Row
.Range("C4:C" & lastrow3 + 1).Value = Worksheets("ADL_PLAN").Range("A3:A" & lastrow3).Value
.Range("H4:H" & lastrow3 + 1).Value = Worksheets("ADL_PLAN").Range("D3:D" & lastrow3).Value
.Range("I4:I" & lastrow3 + 1).Value = Worksheets("ADL_PLAN").Range("H3:H" & lastrow3).Value
lastrow4 = Sheets("Gantt").Range("C48576").End(xlUp).Row
End With
Application.ScreenUpdating = True
End Sub
http://asset-9.soup.io/asset/6671/2313_9f32.xlsm