Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I program in VBA some Excel behaviours like colored-cell-.

How do I program in VBA some Excel behaviours like colored-cell-borders
after pressing F2?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default How do I program in VBA some Excel behaviours like colored-cell-.

HI,
Place the following code in 'ThisWorkbook':
'################################################# #######
Sub Auto_Open()
Application.OnKey "{F2}", "myBorders"
End Sub
'################################################# #######

Insert a module and place the following code:
'################################################# #######
Public Sub myBorders()
On Error Resume Next
With Selection.Borders(xlEdgeLeft)
..LineStyle = xlContinuous
..Weight = xlThin 'xlMedium xlThick xlHairline
..ColorIndex = 15
End With
With Selection.Borders(xlEdgeTop)
..LineStyle = xlContinuous
..Weight = xlThin 'xlMedium xlThick xlHairline
..ColorIndex = 15
End With
With Selection.Borders(xlEdgeBottom)
..LineStyle = xlContinuous
..Weight = xlThin 'xlMedium xlThick xlHairline
..ColorIndex = 15
End With
With Selection.Borders(xlEdgeRight)
..LineStyle = xlContinuous
..Weight = xlThin 'xlMedium xlThick xlHairline
..ColorIndex = 15
End With
End Sub
'################################################# #######
HTH--Lonnie M.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default How do I program in VBA some Excel behaviours like colored-cell-.

If you could explain more precisely what you would like to do then I may be
able to help.

Exactly which behaviours do you wish to emulate?

"TEXNAC" wrote:

How do I program in VBA some Excel behaviours like colored-cell-borders
after pressing F2?

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
Excel 2007 - cell borders not visible when cells colored JLW1 Excel Discussion (Misc queries) 3 February 28th 11 06:33 PM
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
colored a cell Bill Excel Programming 2 June 5th 04 12:31 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM
Cell right next to colored cells is automatically colored on entering a value Johan De Schutter Excel Programming 6 September 12th 03 05:31 PM


All times are GMT +1. The time now is 04:16 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"