Sending a moving range of cells to different people

Saschah

New Member
Joined
Sep 13, 2017
Messages
27
Hey Guys,

Okay this is going to be difficult to explain... :)

First let me explain what I am trying to do.

I have made a big planning with 46 different people in. They all have their collum. (dates are on the rows)
They all need to get their piece of the planning.

That for the easy part..

The planning grows each week,
The days in the past remain in the planning while every week I add new weeks...
Each person needs to get their planning for the next 3 months.

So i'll try to set up an example:

We have a person C, D, F and G, named after their collums. (G's planning has multiple collums)

This week they need to get their planning as in:

C needs: Cell C5:C50
D needs: Cell D5:D50
F needs: Cell F5:F50
G needs: Cell G5:I50

Next week they need to get this planning:
C needs: Cell C10:C55
D needs: Cell D10:D55
F needs: Cell F10:F55
G needs: Cell G10:I55


So i think the moving part is the most difficult?

I have worked something out with different tabs per person but when i move stuff around it doesn't always changes which kind of makes my planning useless...

Could you guys/girls help me out?
If I didn't explained it clear enough, just let me know.

Thanks!!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
The moving Part is a filter.
Does it matter what output they receive. Could they receive a XPS/PDF or does it have to be Excel or table pasted to Email?

You could build a Pivot Table for Each recipient using only ROWs. Date and Column
 
Upvote 0
Hey SpillerBD,

Thanks for your quick response.
I prefer them to get a PDF.

What should happen is:

A B C D E F

Date Person 1 Person 2 Person 3 Person 4 Person 4

01/01/2017 PlaceA PlaceE PlaceB PlaceA PlaceC
02/01/2017 .......................................
....
...
.
...
.
.
.
.

And then they only need to get their colum with the range of the next ... weeks from "today"
 
Upvote 0
I'd use Pivot Table Reporting. What version of Excel are you using?
 
Upvote 0
Well, I'm fairly new to all the advanced features of Excel... :)
Could you explain what this Pivot Table is?

I'm using Excel 2016
 
Upvote 0
Hi, you could give the below macro a try:

I prefer them to get a PDF.

It creates PDF documents in the folder specified (see comments in code) named after the persons name.


A B C D E F

Date Person 1 Person 2 Person 3 Person 4 Person 4

01/01/2017 PlaceA PlaceE PlaceB PlaceA PlaceC
02/01/2017 .......................................
....

And assumes that this table begins in cell A1 of the active sheet.

Code:
Sub M1()
Dim i As Long, oldPrintA As String, dStart As Long, dEnd As Long
Const sFolder As String = "C:\Temp" 'Change folder path here
dStart = Date
dEnd = DateAdd("WW", 10, dStart) '10 = number of weeks
With Range("A1").CurrentRegion
    oldPrintA = .Parent.PageSetup.PrintArea
    For i = 2 To .Columns.Count '2 = Colum where the names start
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:=">=" & dStart, Operator:=xlAnd, Criteria2:="<=" & dEnd
        .AutoFilter Field:=i, Criteria1:="<>"
        .Parent.PageSetup.PrintArea = .Resize(, i).Address
        .Parent.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFolder & "\" & Cells(1, i).Value & ".PDF", OpenAfterPublish:=False
        .Columns(i).Hidden = True
    Next i
    .Parent.PageSetup.PrintArea = oldPrintA
    .Columns.Hidden = False
    .AutoFilter
End With
End Sub
 
Last edited:
Upvote 0
Hi, you could give the below macro a try:



It creates PDF documents in the folder specified (see comments in code) named after the persons name.



And assumes that this table begins in cell A1 of the active sheet.

Code:
Sub M1()
Dim i As Long, oldPrintA As String, dStart As Long, dEnd As Long
Const sFolder As String = "C:\Temp" 'Change folder path here
dStart = Date
dEnd = DateAdd("WW", 10, dStart) '10 = number of weeks
With Range("A1").CurrentRegion
    oldPrintA = .Parent.PageSetup.PrintArea
    For i = 2 To .Columns.Count '2 = Colum where the names start
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:=">=" & dStart, Operator:=xlAnd, Criteria2:="<=" & dEnd
        .AutoFilter Field:=i, Criteria1:="<>"
        .Parent.PageSetup.PrintArea = .Resize(, i).Address
        .Parent.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFolder & "\" & Cells(1, i).Value & ".PDF", OpenAfterPublish:=False
        .Columns(i).Hidden = True
    Next i
    .Parent.PageSetup.PrintArea = oldPrintA
    .Columns.Hidden = False
    .AutoFilter
End With
End Sub


Hey Formr,

Thanks for your response,
When I use this Macro it doesn't work.

Maybe if I give you an example it might help?

First an example of my schedule
https://ibb.co/eiQmYk

And the code with the error
https://ibb.co/cahYDk
 
Upvote 0
Hi, pictures don't help much I'm afraid as they would require any potential helper to manually re-type all the data to test with and they are especially un-helpful when we can't see the column or row labels.

See here for ways to post example data directly in the thread:

https://www.mrexcel.com/forum/about-board/508133-attachments.html

Below was my test set-up, if you re-create it in a new workbook and use the code in post#7 do you get the results you would expect?


Excel 2013/2016
ABCDEF
1DatePerson1Person2Person3Person4Person5
201/09/2017PlaceAPlaceEPlaceBPlaceAPlaceC
302/09/2017
403/09/2017PlaceAPlaceB
504/09/2017PlaceAPlaceA
605/09/2017PlaceBPlaceC
706/09/2017PlaceE
807/09/2017PlaceAPlaceEPlaceBPlaceAPlaceC
908/09/2017
1009/09/2017PlaceAPlaceB
1110/09/2017PlaceAPlaceA
1211/09/2017PlaceBPlaceC
1312/09/2017PlaceE
1413/09/2017PlaceAPlaceEPlaceBPlaceAPlaceC
1514/09/2017
1615/09/2017PlaceAPlaceB
1716/09/2017PlaceAPlaceA
1817/09/2017PlaceBPlaceC
Sheet1
 
Upvote 0
Excel Workbook
ABCDEFGHIJKLMNO
1Kolom1Def. ContractDatumFundering BartFundering BruynseraedeFundering DitroFundering Y. HaelenFundering WDBFundering KelderBT-WorksMontage JohanMontage MikiMontage TimoMontage RoelMontage V. Boxelaer
20W 27
3003 jul 17Frans F3Yperman M-01 (J)Jondral M-01 (J)Hurts M-01 (S)Gevers M-01 (J)
4004 jul 17Yperman M-01 (J)Jondral M-01 (J)Hurts M-01 (S)V. Ammel Ramen
50Pinto (S)05 jul 17Hamerlinck F3Yperman M-01 (J)Jondral M-01 (J)Hurts M-01 (S)V. Ammel Ramen
60Geerts (S)06 jul 17Pinto F3Hurts M-01 (S)Hurts M-01 (S)Hurts M-01 (S)Braspenning (S) Glas +
7007 jul 17Van Dessel uitzettenHurts M-01 (S)Hurts M-01 (S)Hurts M-01 (S)Eco-Dop
80W 31VerlofVerlof
9031 jul 17Pinto (S) muurbalkenHamerlinck (J) Muurl.Hurts M-01 (S)De Jongh M-01 (J)Hurts M-01 (S)De Jongh M-01 (J)VD Eeden M-01 (J)
10001 aug 17Geerts (S) F1Frans M-01 (S)Pinto M-01 (S)Jondral M-01 (J)De Jongh M-01 (J)VD Eeden M-01 (J)
110Van Dessel (J)02 aug 17Carpentier (J) Uitz. + VD VeldeGeerts (S) F2Frans M-01 (S)Pinto M-01 (S)Verberckmoes (J) M-02Maat (L)VD Eeden M-01 (J)
120Carpentier (J)03 aug 17V. Doninck (J) + VD Velde Riol.Geerts (S) F2Verberckmoes (J) M-02Pinto M-01 (S)Verberckmoes (J) M-02Maat (L)VD Eeden M-01 (J)
130Gobeyn (J)04 aug 17Carpentier (J) F1Pinto M-01 (S)Pinto M-01 (S)Verberckmoes (J) M-02Maat (L)VD Eeden M-01 (J)
140W 32Werkweek
150Bellemans (M)07 aug 17De Hondt (S) RioleringGeerts (S) F3Bellemans (M) Muurl.Frans M-01 (S)Pinto M-01 (S)Verberckmoes (J) M-02CeuppensVD Eeden M-01 (J)
16008 aug 17Colp. F-1Geerts (S) Muurl.Frans M-01 (S)Frans M-01 (S)Hurts M-02 (S)Hurts M-02 (S)Hamerlinck (J) M-01
170De Copin (S) 10u09 aug 17Van Dessel (J) F1Frans M-01 (S)Frans M-01 (S)Hurts M-02 (S)Hurts M-02 (S)Hamerlinck (J) M-01
180Laster (S) 10u10 aug 17De Copin (S) F1Van Dessel (J) KelderFrans M-01 (S)Frans M-01 (S)Engelen (S) Ramen 10/8Engelen (S) Ramen 10/8Hamerlinck (J) M-01
19011 aug 17Carpentier (J) F3 + Muurl.Van Dessel (J) KelderDickens (S) Muurl.Frans M-01 (S)Bellemans (M) M-01Bellemans (M) M-01Engelen (S) M-02Hamerlinck (J) M-01
200W 33
210Dickens (S) 13u14 aug 17De Copin (S) F-2Van Dessel (J) KelderBellemans (M) M-01Bellemans (M) M-01Geerts (S) M-01Geerts (S) M-01
22015 aug 17
230Huysmans (P)16 aug 17Lasters (S) F1Van Dessel (J) KelderBellemans (M) M-01Bellemans (M) M-01Geerts (S) M-01Geerts (S) M-01Hamerlinck (J) M-01
Huidige planning
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top