• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Changing font and size using macros (VBA code)

How do I code macros (VBA) in Excel - to change a font style/size in a worksheet

  • VBA Macro in Excel

    Votes: 0 0.0%
  • Macros Excel

    Votes: 0 0.0%

  • Total voters
    0

Ama

Member
Hi, Its Ama again, How do I write the code in vba for excel to change a font style and size for the who worksheet. Ive got

Sub Validate()

With Sheets("Combine").Range("A2:J2")
With .Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 12
End With

End With

I definitely think I'm wrong with this. Could you help me with the following?

I am trying to write a Macro Validate to perform validate and summarise tasks according to the details below. The macro will be attached to the button with caption Validate on the Summary sheet

Validate and summarise details
The following tasks (not listed in any particular order) are to be accomplished with mcrValidate:

• In row 1 of sheet Combined write the following column headings: Last name, First name, Gender, DOB, Address, Suburb, State, Postcode, Role, Category.

• There was a variety of fonts in the eight individual states sheets which will be carried into sheet Combined during the import. Standardise all fonts to Arial 12 pt.

• The column Category in sheet Combined was not in the original states data. Its purpose is to record the age category for each member. The various categories from Junior to Great Grand Master are shown in the table below. For each row of member data, generate the age category for column Category. Hint: Firstly, for each row subtract DOB from your Nationals date (see Summary sheet) to find the member's expected age on the day of competition, then compare with the category table below. Write out the category data for the member in full - for example if a person is 50 years old write Grand Master.

Category Age
Junior Under 18
Senior 18+
Master 40+
Grand Master 50+
Great Grand Master 60+

Calculate summary numbers and write them in the correct cells of the table in sheet Summary.
 

Attachments

  • National2.xlsm
    279.2 KB · Views: 2
Back
Top