ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet scroll based on variable (https://www.excelbanter.com/excel-programming/339248-sheet-scroll-based-variable.html)

Biff

Sheet scroll based on variable
 
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



Stefi

Sheet scroll based on variable
 
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 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




Biff

Sheet scroll based on variable
 
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

"Stefi" wrote in message
...
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 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






Biff

Sheet scroll based on variable
 
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

"Biff" wrote in message
...
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

"Stefi" wrote in message
...
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 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









All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com