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

i dont really know anything about macros but i need to insert a command
button into a calendar that, once pushed will insert "vacation" and
background color into the cell that is high-lighted.

can anyone please help me!!!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default writing macros

On May 28, 2:57 pm, dapco2006
wrote:
i dont really know anything about macros but i need to insert a command
button into a calendar that, once pushed will insert "vacation" and
background color into the cell that is high-lighted.

can anyone please help me!!!



I used the Tools/Macros/Record macro to do the actions you described
and got pretty much the whole thing ...

Public Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/28/2008 by Tom Lavedas
'

'
ActiveCell.FormulaR1C1 = "Vacation"
With ActiveCell.Interior
.ColorIndex = 6 ' yellow
.Pattern = xlSolid
End With
End Sub

Then I activated the Control Toolbox (View/Toolbars), selected design
mode and pasted in the button, right clicked on the button and
selected View code and added the word Macro1 to the supplied code
framework for CommandButton1 and modified the macro subroutine by
making it Public ...

Private Sub CommandButton1_Click()
Macro1
End Sub

Turned off design mode and tested it on cell A1. Worked the first
time. Elapsed time 3 minutes. The Record macro tool is your
friend ;-)

The macro code could also be moved to the CommandButton routine
instead and the macro routine deleted.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
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
Writing Search Macros gwtechie72 New Users to Excel 6 November 12th 07 01:34 PM
Writing Macros GRoger Excel Discussion (Misc queries) 2 October 25th 07 10:43 PM
writing excel macros TMiGNa Excel Programming 11 August 24th 06 05:44 PM
Writing Macros sportsbarn Excel Worksheet Functions 2 April 7th 06 10:40 AM
Writing Macros [email protected] Excel Programming 0 March 9th 06 02:42 AM


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