Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro help for a beginner


hi all, first time ive been here so please bear with me. the problem
have is that i know nothing about writing macro's (all i know is how t
open VB Editor,lol) i have been given the task of trying to work out
macro for a spreadsheet we use, basically what it needs to do (if i
can be done) is this : we have a coloum that needs to have a 'tick
icon in the cell, however if we can we would like this to happen b
just being able to click on the cell and the icon appears and then i
we click on the same cell the icon will be removed, this same actio
needs to happen on each cell in that coloumn so we can go down to an
cell and put a tick in it just by clicking the box like a checklist.
hope this explains it ok if not then please tell me what info would b
useful and i will try my best. Any advice on how i do this is greatl
appreciated, thanks in advance

--
Dan
-----------------------------------------------------------------------
Danz's Profile: http://www.excelforum.com/member.php...fo&userid=1644
View this thread: http://www.excelforum.com/showthread.php?threadid=27808

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default macro help for a beginner

Danz,

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
End If
.Offset(0, 1).Select
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Danz" wrote in message
...

hi all, first time ive been here so please bear with me. the problem i
have is that i know nothing about writing macro's (all i know is how to
open VB Editor,lol) i have been given the task of trying to work out a
macro for a spreadsheet we use, basically what it needs to do (if it
can be done) is this : we have a coloum that needs to have a 'tick'
icon in the cell, however if we can we would like this to happen by
just being able to click on the cell and the icon appears and then if
we click on the same cell the icon will be removed, this same action
needs to happen on each cell in that coloumn so we can go down to any
cell and put a tick in it just by clicking the box like a checklist. I
hope this explains it ok if not then please tell me what info would be
useful and i will try my best. Any advice on how i do this is greatly
appreciated, thanks in advance.


--
Danz
------------------------------------------------------------------------
Danz's Profile:

http://www.excelforum.com/member.php...o&userid=16448
View this thread: http://www.excelforum.com/showthread...hreadid=278087



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default macro help for a beginner

Danz

Does exactly what you want, (Currently works on column A), providing you
have 'Wingdings' font installed. It may be better to use a 'double-click'
event as this one is detecting a selection change. If you click twice to
'toggle' the tick on and off, you do not change selection and it does not
fire. To implement this code go to

http://www.nickhodge.co.uk/vba/vbaim....htm#EventCode

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then
If IsEmpty(Target.Value) Then
With Target
.Font.Name = "Wingdings"
.Value = Chr(252)
End With
Else
Target.Value = ""
End If
End If
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Danz" wrote in message
...

hi all, first time ive been here so please bear with me. the problem i
have is that i know nothing about writing macro's (all i know is how to
open VB Editor,lol) i have been given the task of trying to work out a
macro for a spreadsheet we use, basically what it needs to do (if it
can be done) is this : we have a coloum that needs to have a 'tick'
icon in the cell, however if we can we would like this to happen by
just being able to click on the cell and the icon appears and then if
we click on the same cell the icon will be removed, this same action
needs to happen on each cell in that coloumn so we can go down to any
cell and put a tick in it just by clicking the box like a checklist. I
hope this explains it ok if not then please tell me what info would be
useful and i will try my best. Any advice on how i do this is greatly
appreciated, thanks in advance.


--
Danz
------------------------------------------------------------------------
Danz's Profile:
http://www.excelforum.com/member.php...o&userid=16448
View this thread: http://www.excelforum.com/showthread...hreadid=278087



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
Beginner question! Pat Excel Discussion (Misc queries) 3 August 7th 06 09:19 AM
Macro for a beginner Masha Excel Discussion (Misc queries) 2 February 14th 06 06:42 AM
Macro beginner - Echo Mary Ann Excel Discussion (Misc queries) 2 December 10th 05 12:41 PM
Beginner VBA question light Excel Programming 0 November 10th 04 05:40 PM
Beginner VBA question light Excel Programming 1 November 10th 04 01:44 PM


All times are GMT +1. The time now is 03:41 AM.

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

About Us

"It's about Microsoft Excel"