Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2018, 06:39 AM
Hankced Hankced is offline How to always keep certains lines at the top? Windows 7 64bit How to always keep certains lines at the top? Office 2016
Novice
How to always keep certains lines at the top?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default How to always keep certains lines at the top?

Hi all
In my pic, the first 5 lines are always atop every others. How do we call, manage, add and remove these options?
Attached Images
File Type: gif hgfc.gif (190.8 KB, 20 views)
Reply With Quote
  #2  
Old 04-19-2018, 06:48 AM
Logit Logit is online now How to always keep certains lines at the top? Windows 10 How to always keep certains lines at the top? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

It sounds like you are wanting to create a TEMPLATE of your sheet so you can easily re-create it as often as needed.

Here is code to do that :

Code:
Option Explicit

Sub HyperLnksCreate()
Dim wsRecipes As Worksheet, wsTEMP As Worksheet, wasVISIBLE As Boolean
Dim shNAMES As Range, Nm As Range
Dim i As Long
Dim wsIndex
On Error Resume Next

With ThisWorkbook                                               'keep focus in this workbook
    Set wsTEMP = .Sheets("Template")                            'sheet to be copied
    wasVISIBLE = (wsTEMP.Visible = xlSheetVisible)              'check if it's hidden or not
    If Not wasVISIBLE Then wsTEMP.Visible = xlSheetVisible      'make it visible
    
    Set wsIndex = .Sheets("Index")                            'sheet with names
                                                                'range to find names to be checked
    Set shNAMES = wsIndex.Range("A2:A" & Rows.Count).SpecialCells(xlConstants)     'or xlFormulas
    
    Application.ScreenUpdating = False                              'speed up macro
    For Each Nm In shNAMES                                          'check one name at a time
        If Not Evaluate("ISREF('" & CStr(Nm.Text) & "'!A2)") Then   'if sheet does not exist...
            wsTEMP.Copy After:=.Sheets(.Sheets.Count)               '...create it from template
            'ActiveSheet.Range("A1").Value = (Nm.Text)
            ActiveSheet.Name = CStr(Nm.Text)                        '...rename it
         End If
         
    With Sheets("Index")                                                         'create hyperlinks in list
        For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
        .Hyperlinks.Add Anchor:=.Range("A" & i), Address:="", _
        SubAddress:="'" & .Range("A" & i).Value '& "'!A2" ', TextToDisplay:=.Range("A" & i).Value
        Next i
    End With

    Next Nm
    
    wsIndex.Activate                                           'return to the master sheet
    If Not wasVISIBLE Then wsTEMP.Visible = xlSheetHidden       'hide the template if necessary
    Application.ScreenUpdating = True                           'update screen one time at the end

End With

MsgBox "All sheets created"
End Sub
Attached Files
File Type: xlsm New Tab From List w Template.xlsm (20.9 KB, 7 views)
Reply With Quote
  #3  
Old 04-19-2018, 06:53 AM
Hankced Hankced is offline How to always keep certains lines at the top? Windows 7 64bit How to always keep certains lines at the top? Office 2016
Novice
How to always keep certains lines at the top?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

Code? Anyway, no I don't to recreate anything.
More like: as I scroll through my sheet, these lines are always visible.
Thanks for your help btw
Reply With Quote
  #4  
Old 04-19-2018, 07:17 AM
Logit Logit is online now How to always keep certains lines at the top? Windows 10 How to always keep certains lines at the top? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

I understand your need now.

On the left side of worksheet click on row # 6.

Go to menu bar up top, click on VIEW / FREEZE PANES / FREEZE PANES.

That's all.
Reply With Quote
  #5  
Old 04-19-2018, 07:35 AM
Hankced Hankced is offline How to always keep certains lines at the top? Windows 7 64bit How to always keep certains lines at the top? Office 2016
Novice
How to always keep certains lines at the top?
 
Join Date: Apr 2018
Posts: 11
Hankced is on a distinguished road
Default

YAAY thank you very much!!
Reply With Quote
  #6  
Old 04-19-2018, 09:26 AM
Logit Logit is online now How to always keep certains lines at the top? Windows 10 How to always keep certains lines at the top? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to add space between lines of bulleted text and a new header but both lines are moving??? Martin_d35 Word 2 02-10-2017 07:13 AM
How to always keep certains lines at the top? First Lines dlapham9 Word 1 10-26-2016 07:23 PM
Deleting grid lines but keeping the axis lines CoffeeNut Excel 0 04-01-2013 01:50 PM
How to always keep certains lines at the top? Can't get rid of lines. gfswolf Word 6 01-02-2012 02:33 PM
How to always keep certains lines at the top? Getting blank lines instead of supressed lines. Welshie82 Mail Merge 2 11-14-2011 01:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft