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_change font style


hi,

i'm a beginner in macros and now i have a little problem, which is very
easy, but not for me....so please help me....

so i'm trying to write a macro, which will change font style in some
cells to "strikethrough", when i type in other cell "ok".

I wrote a very simply macro and it really works, but I must run it
after i type "ok" in cell to make affect. is there any way to make it
automatically....

Thanks

tommy


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=394180

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro_change font style

Did you check out the link at Chip Pearson's site where this is explained in
pretty good detail?

--
Regards,
Tom Ogilvy

"tommy_gtr" wrote
in message ...

thank you for your answer,

but I'm a really beginner and I tried your code....it works, but first
I must run your macro and then it call my "change font" macro.

but I'm looking for solution, which automatically change my font always
when I typed "ok" in cell (for example in A1).

maybe I pasted your code on incorrect place.

If you have patience with me, please help....

Thanx


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro_change font style


Hi Tommy_gtr

The point about an event procedure is it run's itself at a prespecifie
event - in this case someone changing a workbook. It doesn't need you
intervention.

Have a look at the picture attached. Does that help?

Dominic

+-------------------------------------------------------------------
|Filename: untitled.zip
|Download: http://www.excelforum.com/attachment.php?postid=3680
+-------------------------------------------------------------------

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=39418

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro_change font style


Dear dominicb,

Thank you for your help....now it really works :-)

I'm a new in writing macros, but I need in very short time learn it.
I know that it's not so easy....
Can you recommend me some good links, books, etc.

I will appreciate your every answer.

Have a nice day :-)


--
tommy_gtr
------------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...o&userid=26089
View this thread: http://www.excelforum.com/showthread...hreadid=394180

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro_change font style


Hi Tommy_gtr

I have found the links below helpful (listed in no particular order
with lots of examples on VBA and how to apply it - but that's not t
say that there aren't hundreds of other sites available to help yo
learn.

http://www.cpearson.com/excel/topic.htm
http://j-walk.com/ss/
http://www.contextures.com

John Walkenbach has written a number of books about VBA, aimed at bot
the beginner and the advanced user, so you might like to get one o
those, availabe from his site above, or usually cheaper from Amazon.
The books usually come with a CD with plenty of examples on.

Also, try and use the examples you come across in your own project
because there's no substitute for practice and expreience.

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=39418



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro_change font style


Hi,

thanks.... I'll check all links.

but I'm sure that it's not so easy way which I have chosen.
I have still problem with my little macro ....

I type "ok" and it's change may font style, but only in absolute way.
I'm trying to write it relatively but till now I'm not very succesful.

This is my code:

Sub Macro 1()

ActiveCell.Offset(-1, -9).Range("A1:I1").Select
With Selection.Font
.Name = "Arial CE"
.Size = 9
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(0, 9).Range("A1").Select
End Sub

and I call it with your macro (which I need to write in a relative wa
(I think)):

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target A
Range)
If Range("L41").Value = "OK" Then Call Macro 1
End Su

--
tommy_gt
-----------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...fo&userid=2608
View this thread: http://www.excelforum.com/showthread.php?threadid=39418

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro_change font style


ok,

I worked on my macro and status is:

Sub strikeout()
'
' strikeout Makro
' Makro zaznamenané 10.8.2005, IM
'

ActiveCell.Offset(-1, -9).Range("A1:I1").Select
With Selection.Font
.Name = "Arial CE"
.Size = 9
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(1, 9).Range("A1").Select


End Sub

and call:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target A
Range)
If Target.Value = "OK" Then Call strikeout
End Sub



but now it doesn't depend on where I type my "ok"..... an it's
problem....cause I have one specific column in which I want to typ
ok

--
tommy_gt
-----------------------------------------------------------------------
tommy_gtr's Profile: http://www.excelforum.com/member.php...fo&userid=2608
View this thread: http://www.excelforum.com/showthread.php?threadid=39418

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
Change the Font Style in VBA justme0010[_2_] Excel Discussion (Misc queries) 1 January 15th 08 04:07 AM
How to write a formula to set the Font Style? Eric Excel Discussion (Misc queries) 2 May 3rd 07 06:40 AM
font style of worksheet functions gvm Excel Worksheet Functions 4 January 20th 06 08:30 PM
macro_change font style dominicb[_84_] Excel Programming 1 August 9th 05 01:51 PM
how do i get font style back on toolbar? melissa Excel Discussion (Misc queries) 2 July 18th 05 08:55 PM


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