Forum Discussion
Need macro excel to show data on change of heading
- Aug 08, 2020
Deleted
Here is the workbook with the updated code.
HansVogelaar "To Date" = From Date + 1
Deleted
So 'No of Days' will always be 1?
- AnonymousAug 14, 2020
HansVogelaar it's ok.. not to be sorry... u helped me to the fullest.
Thanks for your all your efforts, and your time. Your are wonderful and have good hands in programming
All the best !
- HansVogelaarAug 14, 2020MVP
Deleted
I'm afraid this is beyond the scope of the help that I can offer you, sorry.
- AnonymousAug 14, 2020
HansVogelaar Pls check attachment.
I have included a sample graph. i want to link the data shown in sample graph with sheet 4 with the latest sales record data (Example from row no 31).
the graph should change dynamically as and when the data of sheet 4 gets refresh with new latest data at the bottom.
- HansVogelaarAug 14, 2020MVP
Deleted
Can you provide an example of what the chart should look like? Thanks in advance.
- AnonymousAug 14, 2020
HansVogelaar - Hi, will it be possible to create bar graph using sheet 4 data.
- AnonymousAug 14, 2020
HansVogelaar Thank u.. for sheet 4
- HansVogelaarAug 13, 2020MVP
Deleted
As for Sheet2: I already mentioned that you should leave at least one empty row and column around the summary table, and that it is dangerous to place information to the right and below it. If you want to 'decorate' Sheet 2, place all the extra information at the top, and the summary table below it.
So in its current state, it won't work.
In the attached version, I have updated the code behind Sheet4. It should now handle inserting new rows and columns.
- AnonymousAug 13, 2020
HansVogelaar i m not making complicated. I downloade this sheet from a tool which exports data dynamically in sheet 1.
The format in sheet 1 is not constant it dynamically changes with data every 2 mins. Sometimes the tool adds new columns in the sheet or sometimes not dynamically. Position of columns are not fixed and defined in sheet 1.
Actually i want that code should read Sheet 1 Data and can run the functionality of Sheet 2, Sheet 3 and Sheet 4 no matter how many columns and rows are added in Sheet 1.
Only constant part in sheet one is headings. Even row no 1 "Table" is also not required in sheet 1.
- HansVogelaarAug 13, 2020MVP
Deleted
You're making it really complicated!
- AnonymousAug 13, 2020
HansVogelaar yes i want i should be able to add column in sheet 1 (in middle or even in last)
- HansVogelaarAug 13, 2020MVP
Deleted
Is it possible that you will add columns to the right of the Date column on Sheet1 in the future?
- AnonymousAug 13, 2020
Hey.. sheet 4 gives me an error if i add an extra column in sheet 1.
Also in Sheet 2 the functionality is not working if i shift the table in "D14" and decorate with the sheet with some info.
Demo Sheet attached.
- AnonymousAug 11, 2020
- HansVogelaarAug 11, 2020MVP
Deleted
In the worksheet module of Sheet4:
Private Sub Worksheet_Activate() Dim m As Long Dim r As Long Dim r0 As Long Dim d As Date Dim n As Long Application.ScreenUpdating = False Application.EnableEvents = False Range("C4:J" & Rows.Count).Clear With Worksheets("Sheet1") m = .Range("A" & .Rows.Count).End(xlUp).Row .Range("A3:F" & m).Copy Destination:=Range("C4") End With For r = 4 To m + 1 With Range("H" & r) .Value = Int(.Value) End With Next r With Range("I4:I" & m + 1) .Formula = "=H4+1" .Value = .Value End With Range("H4:I" & m + 1).NumberFormat = "dddd, mmmm dd, yyyy" With Range("J4:J" & m + 1) .Formula = "=I4-H4" .Value = .Value End With Range("C4:J" & m + 1).HorizontalAlignment = xlHAlignCenter Range("H4:J" & m + 1).Borders.LineStyle = xlContinuous r = 4 Do If Range("H" & r).Value > d + 6 Then d = Range("H" & r).Value d = d + 1 - Weekday(d, vbMonday) Range("C" & r).Resize(1, 8).Insert Shift:=xlShiftDown With Range("C" & r).Resize(1, 8) .Interior.Color = vbYellow .Font.Bold = True End With If r0 > 0 Then Range("J" & r0).Value = n Else Range("H" & r).Resize(1, 2).NumberFormat = "dddd, mmmm dd, yyyy" End If Range("C" & r).Value = "Code" Range("H" & r).Value = d Range("I" & r).Value = d + 4 r0 = r n = 0 r = r + 1 End If n = n + Range("J" & r).Value r = r + 1 Loop Until Range("C" & r).Value = "" If r0 > 0 Then Range("J" & r0).Value = n End If Application.EnableEvents = True Application.ScreenUpdating = True End Sub - AnonymousAug 11, 2020
HansVogelaar yes it will be From Date - To Date = 1