Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default REQ Help with simple Excel macro

Hi there -

I haven't played around with macros much before and need to ask what must be
an extremely simple question.

I want to create a toolbar button in Excel (this is Excel 2003) to put a
tick in a cell. I recorded a macro of the action (below) but while it puts a
u-umlaut character in the selected cell, it only applies the right font
formatting to cell D7 (where the cursor happened to be at time of recording)
and leaves the current cell as is, whereas it needs to be in the Wingdings
font. I seem to remember in an older version of Office (95?), when you went
in to Record Macro it asked if you wanted to use absolute or relative cell
references, which might have done the trick, but that option seems to have
been moved or removed now. And I know no VBA, not even enough to make basic
changes to the macro.

Can anyone please help?

Many thanks!

Sub Tick()
'
' Tick Macro
' Macro recorded 01/08/2007
'

'
ActiveCell.FormulaR1C1 = "ü"
Range("D7").Select
With Selection.Font
..Name = "Wingdings"
..Size = 10
..Strikethrough = False
..Superscript = False
..Subscript = False
..OutlineFont = False
..Shadow = False
..Underline = xlUnderlineStyleNone
..ColorIndex = xlAutomatic
End With
Selection.Font.Bold = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default REQ Help with simple Excel macro

Hi Olórin, hope this helps... ;0)
This will leave the cursor where it is but change the values of "I7"

Sub Tick()
'
Range("I7") = "ü"
With Range("I7").Font
.Name = "Wingdings"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Bold = True
End With

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default REQ Help with simple Excel macro

Try this:
************
Sub Tick()

With ActiveCell.Offset(0, -1)
.FormulaR1C1 = "ü"
.Font.Name = "Wingdings"
.Font.Size = 10
.Font.Bold = True
End With

End Sub
*************

Change the values in the Offset to put the tick mark wherever you want
(in relation to the activecell) -- as is, the tick-mark will be one
cell to the LEFT of the activecell. OR, to put the tick-mark IN the
activecell, just delete the Offset property altogether ...

br//ray

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default REQ Help with simple Excel macro

Thanks, but "always I7" isn't a huge improvement on "always D7"... or am I
missing something?

"Les Stout" wrote in message
...
Hi Olórin, hope this helps... ;0)
This will leave the cursor where it is but change the values of "I7"

Sub Tick()
'
Range("I7") = "ü"
With Range("I7").Font
.Name = "Wingdings"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Bold = True
End With

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default REQ Help with simple Excel macro

Thanks, Ray - I get the picture now. All working fine.

"Ray" wrote in message
ups.com...
Try this:
************
Sub Tick()

With ActiveCell.Offset(0, -1)
.FormulaR1C1 = "ü"
.Font.Name = "Wingdings"
.Font.Size = 10
.Font.Bold = True
End With

End Sub
*************

Change the values in the Offset to put the tick mark wherever you want
(in relation to the activecell) -- as is, the tick-mark will be one
cell to the LEFT of the activecell. OR, to put the tick-mark IN the
activecell, just delete the Offset property altogether ...

br//ray




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default REQ Help with simple Excel macro

Hi,

Just Change the "I7" for the cell where you want the Tick to be.


Sub Tick()
'
Range("I7") = "ü"With Range("I7").Font'<== And here...
.Name = "Wingdings"
.Size = 10
.Bold = True
End With

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
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
Simple Excel Macro TimWillDoIt New Users to Excel 5 April 25th 07 06:17 PM
Help with a simple Excel macro Dan R. Excel Programming 4 December 27th 06 07:34 PM
simple excel macro Q excelbeginner Excel Programming 2 March 8th 06 08:06 PM
simple excel vba macro Andrew Slentz Excel Programming 4 May 21st 04 08:57 AM
Simple Excel Macro - Please Help Curious[_3_] Excel Programming 7 October 23rd 03 04:26 PM


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