Hello Friends..
Title seems weird but to be honest I don't know exactly how to explain my problem and ask for help about it.
Okay, there i go..
The code was working good for one report, but i was asked to build 4 new report using same date data with different ranges (and eventually up to 14 reports), because by experience i saw this code was working good, then i copied the code 4 times, replaced the necessary range on each one and add a macro to call multiples macro at once (the 4 reports). But now the macros only build the first 4 reports at once, but when the data is updated and able to build the other 4 reports it just wont work,It pretend that work when is called (with no errors) but report values state the same.
i'm in to this problem for over 7 days and i don't have clear idea what can be the problem because i tried many ways to solve it.
So, i decide to ask you : Can i merge the 4 (or 6+ reports Ranges ) to manage only 1 VBA code and not many code (1 code for each report)??
please see my good code copy for One Report and also please see my ranges for each report it might help you to help me,
Note:
1-.Report are named Report1, Report2, Report3, Report4, etc,etc
2-.All data source and reports are located on same worksheet
Spec of each ranges/value to be applied on each Line Code (ill High Light )
For j = 4 To 51 <--- Report 1
For j = 326 To 331 <--- Report 2
For j = 326 To 332 <--- Report 3
For j = 326 To 333 <--- Report 4
=====
If Cells(j, 359).Value > 1 And Cells(j, 359).Value < 136 Then _ '<--- Same Value for each report
=====
Cells(Rows.Count, 147).End(xlUp).Offset(1).Resize(, 50).Value = Cells(j, 359).Resize(, 50).Value <-- Report 1
Cells(Rows.Count, 478).End(xlUp).Offset(1).Resize(, 22).Value = Cells(j, 359).Resize(, 22).Value <-- Report 2
Cells(Rows.Count, 566).End(xlUp).Offset(1).Resize(, 22).Value = Cells(j, 359).Resize(, 22).Value <-- Report 3
Cells(Rows.Count, 654).End(xlUp).Offset(1).Resize(, 22).Value = Cells(j, 359).Resize(, 22).Value <-- Report 4
Report 1
=====
lr = Range("EV" & Rows.Count).End(xlUp).Row '----------> "EV" = DATE Column
With Range("EQ2:GN" & lr)'---------------------------------> "EQ2:GN" = First/Last Column Range where Report is Going to be copy
.Sort key1:=[EV3], order1:=xlDescending, Header:=xlYes '-> When add Report with new date, it copied at top. older descending
Report 2
======
lr = Range("RO" & Rows.Count).End(xlUp).Row '-----------> "RO" = DATE Column
With Range("RJ2:SE" & lr)'-----------------------------------> "RJ2:SE" = First/Last Column Range where Report is Going to be copy
.Sort key1:=[RO3], order1:=xlDescending, Header:=xlYes '-> When add Report with new date, it copied at top older descending
Report 3
=====
lr = Range("UY" & Rows.Count).End(xlUp).Row '------------> "UY" = DATE Column
With Range("UT2:VO" & lr)''-----------------------------------> "UT2:VO" = First/Last Column Range where Report is Going to be copy
.Sort key1:=[UY3], order1:=xlDescending, Header:=xlYes '<-When add Report with new date, it copied at top older descending
Report 4
======
lr = Range("YI" & Rows.Count).End(xlUp).Row '-----------> "YI" = DATE Column
With Range("YD2:YY" & lr)''---------------------------------> "YD2:YY" = First/Last Column Range where Report is Going to be Copy
Sort key1:=[YI3], order1:=xlDescending, Header:=xlYes '<-When add Report with new date, it copied at top older descending
NOTE : This is the Main code I'm using for one report at the time
![]()
Please Login or Register to view this content.
Thank you so much, Appreciate any help!
Bookmarks