slifer666
Board Regular
- Joined
- Sep 29, 2005
- Messages
- 81
hi
i currently use a big list of data, with an autofilter by a field called Workpackage. the autofilter is used to select all instances of each workpackage, and then print the file (to .pdf files)
data sample, from column B:
MHB6068
SWD6500
SWD7500
SWD8103
MHB6000
SWD6900
MHB4200
MHB4300
MHB2200
MHB7000
MHB4800
SWD8103
MHB6068
MHB2200
some of the items are repeated, eg MHB6068
the purpose is to create a .pdf of every row concerning each workpackage. so i auto filter by each work package in turn, and generate a .pdf for each workpackage, showing the data associated with it.
(this is done every day, so it takes a couple hours off my day, and i suspect it can be largely automated)
so. the manual process has been refined as much as i can, but now i'm attempting to automate it. theres a lot that can be done with this via 'recording macros'. but i'm running into some limitations of it that i can't get around.
for example:
1- the workpackages are not consistent each day. in total there is 230ish of them, but usually only about 30-40 are used each day.
when i recorded a macro of changing the selection on the autofilter, it can't recognise that i've just pressed the down arrow to move down the list to the next item, it does this when i look at the macro code:
Selection.AutoFilter Field:=2, Criteria1:="MHB6000"
Selection.AutoFilter Field:=2, Criteria1:="MHB6068"
Selection.AutoFilter Field:=2, Criteria1:="MHB7000"
the problem is, i can't get it to read the Criteria from the actual cell. i think i'd need to pass the data into the macro... or something
tomorrow there may not be anything for MHB6068, so the macro would try and select that, but it'd bring up no results in the autofilter, and if i tried to print it, it'd all be blank (apart from the top rows which are title and column headers and so on)
i want it to try and select each item that's actually in the autofilter, one at a time. (for printing)
i suspect one approach actually, may be to just select every one of the potential workpackages that exists (the full list of 230 available workpackages doesn't change), try to select it, and then if there are no items for that workpackage for that day, just dont print the file and move on to the next one.
this would solve a later problem of how to print each item, and how to know when to stop the loop.
2- edited out - solved
3- edited out - solved, mostly
4- edited out - solved
ok, sorry if that was a bit garbled. if you need anything explained clearer, i'd be happy to, as i'd like any help on this anyone can provide. cheers! :D
i currently use a big list of data, with an autofilter by a field called Workpackage. the autofilter is used to select all instances of each workpackage, and then print the file (to .pdf files)
data sample, from column B:
MHB6068
SWD6500
SWD7500
SWD8103
MHB6000
SWD6900
MHB4200
MHB4300
MHB2200
MHB7000
MHB4800
SWD8103
MHB6068
MHB2200
some of the items are repeated, eg MHB6068
the purpose is to create a .pdf of every row concerning each workpackage. so i auto filter by each work package in turn, and generate a .pdf for each workpackage, showing the data associated with it.
(this is done every day, so it takes a couple hours off my day, and i suspect it can be largely automated)
so. the manual process has been refined as much as i can, but now i'm attempting to automate it. theres a lot that can be done with this via 'recording macros'. but i'm running into some limitations of it that i can't get around.
for example:
1- the workpackages are not consistent each day. in total there is 230ish of them, but usually only about 30-40 are used each day.
when i recorded a macro of changing the selection on the autofilter, it can't recognise that i've just pressed the down arrow to move down the list to the next item, it does this when i look at the macro code:
Selection.AutoFilter Field:=2, Criteria1:="MHB6000"
Selection.AutoFilter Field:=2, Criteria1:="MHB6068"
Selection.AutoFilter Field:=2, Criteria1:="MHB7000"
the problem is, i can't get it to read the Criteria from the actual cell. i think i'd need to pass the data into the macro... or something
tomorrow there may not be anything for MHB6068, so the macro would try and select that, but it'd bring up no results in the autofilter, and if i tried to print it, it'd all be blank (apart from the top rows which are title and column headers and so on)
i want it to try and select each item that's actually in the autofilter, one at a time. (for printing)
i suspect one approach actually, may be to just select every one of the potential workpackages that exists (the full list of 230 available workpackages doesn't change), try to select it, and then if there are no items for that workpackage for that day, just dont print the file and move on to the next one.
this would solve a later problem of how to print each item, and how to know when to stop the loop.
2- edited out - solved
3- edited out - solved, mostly
4- edited out - solved
ok, sorry if that was a bit garbled. if you need anything explained clearer, i'd be happy to, as i'd like any help on this anyone can provide. cheers! :D