Sheet scroll based on variable

  • Thread starter Thread starter Biff
  • Start date Start date
B

Biff

Hi Folks!

Need some help with a macro.

I want to use a data validation drop down to select a variable and based on
that variable have the worksheet scroll down a set amount of rows. The
number of rows to scroll has not yet been determined. I'll have to
experiment to find the exact number. There will be a total of 17 variables
named Week1, Week2, Week3 ....... Week17

Say cell A1 has the drop down. From the drop down I select Week12. I click a
button that the macro is assigned to and the sheet scrolls down X number of
rows. The number of rows to scroll is dependant on which variable is
selected and as I said, I'll need to experiement to find the exact number.

The logic would be something like:

If A1 = Week1 scroll down X number of rows
If A1 = Week2 scroll down X number of rows
etc

Thanks for any help.

Biff
 
scr_row = 5
ActiveWindow.SmallScroll Down:=scr_row

But if you know in what row your week1,week2, ... data begin (say 50 for
week2) then
Range("A50").Select

will scroll automatically to row 50 that is week2.

Regards,
Stefi



„Biff†ezt írta:
 
Hi!

Thanks for the reply but I don't know how to use your suggestion!

How do I implement this based on the variable in cell A1?

IF A1 = Week2 scroll down X number of rows
IF A1 = Week10 scroll down X number of rows

???

Biff
 
Hi!

Just discovered something that I didn't know was possible!

Using F5 to go to a specific location on a sheet, this will accept a
reference such as:

=INDIRECT(A1)

Using this, I should be able to figure out what how to do what I want.

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top