[mso] Re: Macro and VBA in Excel 2003

  • From: "Thomas N. Chan" <da_qing_ren@xxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Fri, 22 Sep 2006 04:10:42 +0800

Thanks for  that
I think I got it working.
 


--------
----------------------
regards
Thomas N. Chan 
Paypal me if you want to help me to fulfilled my dream 
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of David Smart
Sent: Thursday, 21 September 2006 9:11 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Macro and VBA in Excel 2003

Your description doesn't quite match what I see on my 2003.  I'll work 
through your steps

> 1. Select the cell I want to change
> 2. hit Ctrl - 1
> 3. Ctrl - tab to font
> 4. Tab to the font colour combobox
> 5. Down arrow to black
5a.  Hit Enter
> 6. Ctrl - tab to pattern tab
> 7. Tab to the combobox to change it to yellow.
No.  Tab to the "no color" button.  (The combobox is for patterns, not 
normal colours.)
Down and right arrow to the little yellow square.  Hit enter.  The sample 
box will change to yellow.
> 8. There's 2 box I notice, but I changed both to yellow nevertheless.
Do you mean the two little yellow squares?  You only need to select one.
> 9. And tab to ok

I just recorded two macros, one using the mouse and the other using the 
keyboard.  The results were identical and were:

Option Explicit

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 21/09/2006 by David Smart
'

'
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = 1
    End With
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
    End With
End Sub

This macro will do the right thing consistently AFAIK and doesn't contain 
any positioning commands, so will work on whatever area is selected when you

run it.


Regards, Dave S

----- Original Message ----- 
From: "Thomas N. Chan" <da_qing_ren@xxxxxxxxxxxx>
To: <mso@xxxxxxxxxxxxx>
Sent: Thursday, September 21, 2006 3:20 PM
Subject: [mso] Macro and VBA in Excel 2003


> Hi there,
> I am having some problems with the macrom and VBA in excel 2003.
> Here's the situation.
>
> I got a spreadsheet which I need to enter info on it.
> First, I would enter all the info there which is no big deal.
> But heres the challenge. I need to change the background of the cell to
> yellow and font to be black.
> For her to capture the info easily with a glance. I know from the info you
> have read so far, you might think its easy.
> But the challenge comes when if you are me and you can only use keyboard
> shortcuts.
> Here's what I did to accomblish the task.
>
> 1. Select the cell I want to change
> 2. hit Ctrl - 1
> 3. Ctrl - tab to font
> 4. Tab to the font colour combobox
> 5. Down arrow to black
> 6. Ctrl - tab to pattern tab
> 7. Tab to the combobox to change it to yellow.
> 8. There's 2 box I notice, but I changed both to yellow nevertheless.
> 9. And tab to ok
>
> But sometimes the cell change to yellow,  sometimes not.
>
> I am using a screen reader from
> www.gwmicro.com
> So no mouse clicking will be good or even just write a VBA which will
> accomblish such.
> I know I can run a record macro but the fact is  the colour change of the
> cell background is not constant, so the macro will not capture what it
> should do.
>
>
> So any help in this area will be greatly appreciated.
>
> regards
> Thomas N. Chan
>
> Send instant messages to your online friends 
> http://asia.messenger.yahoo.com
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or

> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, visit the group's homepage and use the 
> dropdown menu at the top.  This will allow you to unsubscribe your email 
> address or change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to use the files section for sharing files with the group, send

> a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an 
> invitation with instructions.  Once you are a member of the files group, 
> you can go here to upload/download files:
> http://www.smartgroups.com/vault/msofiles
>
> If you are using Outlook and you see a lot of unnecessary code in your 
> email messages, read these instructions that explain why and how to fix 
> it:
> http://personal-computer-tutor.com/abc3/v28/greg28.htm
> ************************************************************* 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the
dropdown menu at the top.  This will allow you to unsubscribe your email
address or change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions.  Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Send instant messages to your online friends http://asia.messenger.yahoo.com 
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: