?
Solved

VB help

Posted on 2012-08-21
6
Medium Priority
?
348 Views
Last Modified: 2012-08-21
Private Sub CommandButton3_Click()
Dim lstRow As Long
   lstRow = Sheets("Sheet1").Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row + 1
   ActiveSheet.Cells(lstRow, 2).Select

End Sub

Please can you help me with the attached workbook. I was hoping to change to code so that it will only show the last 4 values.
help.xlsm
0
Comment
Question by:Kiwi-123
  • 3
  • 3
6 Comments
 
LVL 39

Expert Comment

by:nutsch
ID: 38318648
What last 4 values? All the lines for the last 4 dates? The last 4 lines?
0
 

Author Comment

by:Kiwi-123
ID: 38318659
Hi Nutsch,

Sorry I didn't explain very well, I just want to display the last 4 lines. So in the example it would be line 19 onwards. Lines 18 - 4 would be hidden inside the freezed pane.
0
 
LVL 39

Expert Comment

by:nutsch
ID: 38318671
like this?

Dim lstRow As Long
   With Sheets("Sheet1")
        lstRow = .Cells(.Rows.Count, "B").End(xlUp).Row
        .Rows("4:" & lstRow - 4).Hidden = True
   End With
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Kiwi-123
ID: 38318709
Yes exaclty like that, however when I press the UP arrow I'd like the full range to be visible again. At the moment the code hides the values so it's not possible to use the UP Arrow.

Thanks
0
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 total points
ID: 38318725
Understood

   ActiveWindow.ScrollRow = lstRow - 4
0
 

Author Closing Comment

by:Kiwi-123
ID: 38318731
Many thanks for your help
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question