View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default shortcut for Highlight cell

Don't use application.onkey inside your macro.

You could use your workbook_open or auto_open to assign the shortcut key to the
macro.

Option Explict
sub auto_Open()
application.onkey "^q", "'" & thisworkbook.name & "'!Highlight"
end sub
sub auto_Close()
application.onkey "^q"
end sub

But you don't need to do this, either.

You can still use that other technique (Tools|macro|macros|options).

But you have to type the name of the macro:
personal.xla!Highlight
in the "macro name" box.

Remember to save that addin, though.

(and still remove the application.onkey from the actual macro.)

Samad wrote:

Dave Sorry to bother you again, I saved all my macros to my personal.xla
(addins) so I'm unable to see my macros on tools|macro|macros, I tried
"Application.onkey" command but unsuccessful (codes pasted below), is any
other way or something else I'm missing?

Thanks

Sub highlight()
'
' highlight Macro
' Macro recorded 24-01-2007 by Abdul Samad
'
' Keyboard Shortcut: Ctrl+q

Application.OnKey "^q"
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub

"Dave Peterson" wrote:

Tools|Macro|macros
select your macro from the list
Click on the Options button
assign your shortcut key there.

Remember to save the workbook with the macro (personal.xls) so you don't lose
your changes.

Samad wrote:

Thanks Dave but one more thing I record a macro and copied it to my
personal.xla for use in all files, it works fine through a toolbar button but
I'm unable to create a keyboard shortcut, is anything I'm missing? please
guide.

thanks

"Dave Peterson" wrote:

I understand your problem.

I guess you could record a macro that changed the fill color of the activecell
and assign it to a keyboard shortcut.

But remember to turn off the fill color when you change cells and it could be a
pain if you shaded other cells you don't want to change.

I don't have any other good solution for you.

Samad wrote:

Dear Dave

rowliner is to identify the cell position but I want to keyboard shorcut to
highlight something. hope you understand my problem

Thanks Guru

"Dave Peterson" wrote:

You may want to try Chip Pearson's Rowliner:
http://www.cpearson.com/excel/RowLiner.htm


Samad wrote:

Is there any keyboard shortcut to highlight current cell?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson