#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
YAAY thank you very much!!
|
#6
|
|||
|
|||
You are welcome.
|
|
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 |
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 |
Can't get rid of lines. | gfswolf | Word | 6 | 01-02-2012 02:33 PM |
Getting blank lines instead of supressed lines. | Welshie82 | Mail Merge | 2 | 11-14-2011 01:41 AM |