View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sandi Gauthier Sandi Gauthier is offline
external usenet poster
 
Posts: 3
Default CODE to select range based on User Input or Value of Input Field

ok...first things first..i'm new to all of this...
i need help!...looking for some code that would export certain info to a new
worksheet, based on USER INPUT...

my db is setup as so - i have a SOURCE WORKBOOK and a SUMMARY WORKBOOK...

SOURCE WORKBOOK
week / sales pro / revenue req'd / revenue achieved / account name /
product ....
1 j. doe 1000.00 2000.00 abc
company widgets
2 j. doe 2000.00 1000.00 xyz
company hammers
3
4
5
to 13

i've NAMED each ROW to reflect the week (ie...Week1, Week2, Week3, Week4,
Week5, Week6, etc...to Week13)

SUMMARY WORKBOOK
i have some code (that i'm going to use from a previous project i worked on)
that enables the user, at the click of a button to EXPORT the data range
that "I" defined into a new workbook...

now, however, i want the user to be able to export info for the WEEK
SPECIFIED BY THEM...for example export info for Week1 only onto new
workbook...

not quite sure how to go about this...

i've already NAMED the ranges so i was thinking perhaps of adding a "prompt"
that would ask the user "Which Week Do You Want to Export?"...then perhaps
have a dropdown list (containing the names of my predefined weekly ranges
ie..Week1, Week2, etc..)

then i'd have to write code to say something like: if answer is Week1 then
Range(Week1).Select, if Week2 then Range(Week2).Select

i THINK i'm on the right track?

appreciate your assistance!
sandi