Oryos
03-15-2016, 02:00 PM
hi everyone,
I'm kinda stuck with my dashboard and I hope you can help me out.
I've a create a dashboard based on data from a kind of log file of software bugs. I've attached the file that describes the situation with the outcome in worksheet Table2.
15655
The dashboard is a summary of all the log incidents that happened on one day and I already wrote a vba code that doesnt really achieve what I want.
Sub test()
Dim rng1 As Range, rng2 As Range, c As Long, b As Long, u As Long, rng3 As Range
Dim find As Date
Dim rng As Range
Dim Table2 As Worksheets
With Worksheets("Table2")
Set rng = Range("A1")
For c = 1 To Sheets("Table1").Range("B" & Rows.Count).End(xlUp).Row
Set rng1 = Sheets("Table1").Range("B" & c)
For b = 1 To Sheets("Table2").Range("A" & Rows.Count).End(xlUp).Row
Set rng2 = Sheets("Table2").Range("A" & b)
If rng1 = rng Then
rng2.Offset(0, 2).Value = rng1.Offset(0, 2).Value
End If
Set rng2 = Nothing
Next b
Set rng1 = Nothing
Next c
End With
End Sub
What i'm basically challenged with are:
1. how do I create a table in the middle of a worksheet? My macro starts from the top of the sheet.
2. how can I merge cells so that they look like in my table?
3. my code loops through the all the cells and overwrites the results it already found. Example: cell value "bug description B" for the 15.03. is found first und written into Table2 column C but afterwards "bug description A" is found too and "bug description B" is overwritten. How can I avoid that?
Thanks for your effort and your thoughts!
I'm kinda stuck with my dashboard and I hope you can help me out.
I've a create a dashboard based on data from a kind of log file of software bugs. I've attached the file that describes the situation with the outcome in worksheet Table2.
15655
The dashboard is a summary of all the log incidents that happened on one day and I already wrote a vba code that doesnt really achieve what I want.
Sub test()
Dim rng1 As Range, rng2 As Range, c As Long, b As Long, u As Long, rng3 As Range
Dim find As Date
Dim rng As Range
Dim Table2 As Worksheets
With Worksheets("Table2")
Set rng = Range("A1")
For c = 1 To Sheets("Table1").Range("B" & Rows.Count).End(xlUp).Row
Set rng1 = Sheets("Table1").Range("B" & c)
For b = 1 To Sheets("Table2").Range("A" & Rows.Count).End(xlUp).Row
Set rng2 = Sheets("Table2").Range("A" & b)
If rng1 = rng Then
rng2.Offset(0, 2).Value = rng1.Offset(0, 2).Value
End If
Set rng2 = Nothing
Next b
Set rng1 = Nothing
Next c
End With
End Sub
What i'm basically challenged with are:
1. how do I create a table in the middle of a worksheet? My macro starts from the top of the sheet.
2. how can I merge cells so that they look like in my table?
3. my code loops through the all the cells and overwrites the results it already found. Example: cell value "bug description B" for the 15.03. is found first und written into Table2 column C but afterwards "bug description A" is found too and "bug description B" is overwritten. How can I avoid that?
Thanks for your effort and your thoughts!