Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Locking panes

I have a macro that does alot of things in a spreadsheet. I want the code to
lock the panes at a certain column. The coulmn is not the same every time so
I cannot simply record a macro but if a record a macro the code is:

Columns("F:F").Select
ActiveWindow.FreezePanes = True

Now I need to replace the first line with something else. I want to lock the
panes where at the column where the word "Securitiy ID" is found. There (with
some help) I wrote:

Set rng2 = Worksheets("Beräkning").Cells.Find("Security ID", LookIn:=xlValues)
......
Columns(rng2.Address).Select
ActiveWindow.FreezePanes = True

but this does not work. Please help me if you have any clue. Thanks!




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Locking panes

Cells.Find(What:="Security ID", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
Columns(ActiveCell.Column).Select
ActiveWindow.FreezePanes = True


*If that doesn't wory, check your spelling of Security, not sure if you
copied and pasted it but there was a spelling mistake!

Cheers

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeze panes swati Excel Worksheet Functions 4 December 7th 09 10:06 PM
row locking, instead of file locking? Bob W Excel Discussion (Misc queries) 2 September 7th 07 09:36 PM
More Dividers for Excel Viewing Panes / multiple panes per axis. bIgJeNkS3 Excel Discussion (Misc queries) 1 August 2nd 06 11:51 PM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM
Panes sequence. Pane Index 2 & 3 depend on how panes are created keepITcool Excel Programming 0 August 17th 05 12:18 PM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"