Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:10:27+00:00 2026-06-05T07:10:27+00:00

I am working on simplifying a worksheet by creating one sheet that has three

  • 0

I am working on simplifying a worksheet by creating one sheet that has three buttons instead of having three tabs to view.

Here is the workbook.

https://dl.dropbox.com/u/3327208/Excel/Archives.xlsx

What I am attempting to do is this, each button corresponds to a specific tab, it will ultimately adjust each field to fit each corresponding column in each tab. Since Archive 1 needs a different format than Archive 2 or 3.

Now this would be a simple Copy and paste concept, but what I want to have done are two things that makes this a little more complex than a basic script because I can create a script that deletes columns, and pastes data into cells but I will be using a scroll bar, and that can’t as far as I can tell be deleted by the same commands or can it? This is what I’m looking for…

– How to create a scroll bar, with all data corresponding to it so it
will work with said active data, so if I push the first button all
data on the screen will correspond to Archive 1, and so will the
scroll bar. If I push button 2, the data and scroll bar will
correspond to Archive 2, etc…

  • Have it so that the number of related rows the scroll bar
    interacts with will always correspond to the last row, so there is no
    “empty” data at the end when the scroll bar hits the bottom.

  • How to delete said scroll bar as well so it can be replaced by others.

– This is a want, not a need, but make it so the cells that the data is entered to interact with the scroll bar, and the scroll bar
will only go so far down as the height of the visible worksheet. So
in English if the worksheet shows 20 rows, that is how far the bar
and the data will go.

Thanks again.

I’ve decided to try using the lastrow concept to make it so that the script will enter the “lastrow” into the .Max for the scroll bar will go no further than the last row of data, here is the code:

    Sub scrollbar()

    Dim lastrow As Long
    Dim wsJAR As Worksheet 'JL Archive
    Dim wsARC As Worksheet 'JL Archive
    Set wsJAR = Sheets("JL Archive")
    Set wsARC = Sheets("Archives")

    With wsARC
    lastrow = wsJAR.Range("B" & .Rows.Count).End(xlUp).Row
    ActiveSheet.ScrollBars.Add(1107, 44, 15, 404).Select

        With Selection
            .Max = lastrow
            .LinkedCell = "Lists!$G$3"
        End With
    End With
End Sub

There are no errors, it’s accepting lastrow as a number, but in continues past the cell even though there is no reason for it to do so.

The last row is 36, now if I take off 13, from 36 it works perfectly, but I can’t imagine that is the answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:10:28+00:00Added an answer on June 5, 2026 at 7:10 am

    Change

    With wsARC
        lastrow = wsJAR.Range("B" & Rows.Count).End(xlUp).Row
        wsARC.FreezePanes = False
        Range("A1:Q13").Select
        Range("Q1").Activate
        wsARC.FreezePanes = True
    End With
    

    to

    With wsARC
        lastrow = wsJAR.Range("B" & .Rows.Count).End(xlUp).Row
        .Activate
        ActiveWindow.FreezePanes = False
        .Range("A1:Q13").Select
        .Range("Q13").Activate
        ActiveWindow.FreezePanes = True
    End With
    

    FINAL CODE

    Sub freezecells()
        Dim lastrow As Long
        Dim wsJAR As Worksheet 'JL Archive
        Dim wsARC As Worksheet 'Archive
    
        Set wsJAR = Sheets("JL Archive")
        Set wsARC = Sheets("Archives")
    
        With wsARC
            lastrow = wsJAR.Range("B" & .Rows.Count).End(xlUp).Row
            .Activate
            ActiveWindow.FreezePanes = False 
            .Range("A1:Q13").Select
            .Range("Q13").Activate
            ActiveWindow.FreezePanes = True
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a message parser/generator subsystem. I'm creating an auto-generator that uses a
I've been working on simplifying a script, I wanted to create a script that
working on xcode I realized that if I create a non-void method, I call
Working in Scala-IDE, I have a Java library, in which one of the methods
Working on a project where I need to add points to an array. Here
I'm looking into re-working and simplifying our error handling in an application I support.
I am currently working on a particularly complex use-case. Simplifying below :) First, a
I'm working on an application that it's been giving me some trouble, partly because
I'm trying to get my caching working correctly so that I don't need to
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.