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


This is probably very easy to do, however I've got no clue as to wha
I'm doing...

Basically I need to program a macro to do the following...

1. Create a new Sheet in an Excel Workbook
2. Draw a grid from Cells A:1 to D:10
3. Format the grid with thick lined borders in Yellow
4. Colour each cell with alternate Red and green colours.

Now I've made an effort and I've got 1 done (I think)

Insert New WorkSheet

Any help would be really appriciated as this is very important that
actually complete this

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Newbie needs help

You can use your macro recorder to get your code Mark
ToolsMacro..Record a New Macro

Do the things you want and study the code

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"MarkJones" wrote in message ...

This is probably very easy to do, however I've got no clue as to what
I'm doing...

Basically I need to program a macro to do the following...

1. Create a new Sheet in an Excel Workbook
2. Draw a grid from Cells A:1 to D:10
3. Format the grid with thick lined borders in Yellow
4. Colour each cell with alternate Red and green colours.

Now I've made an effort and I've got 1 done (I think)

Insert New WorkSheet

Any help would be really appriciated as this is very important that I
actually complete this.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie needs help


It is homework in a way, it's for a job application, the annoying thin
is I'm actually supposed to be learning Excel as part of my training.
even said to the guy doing the interview "I have never programme
anything in Excel"

Oh well, will do it the way you said, thanks

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Newbie needs help

Mark,

Try something like the following:
Dim R As Range
Dim Rng As Range
Dim WS As Worksheet
Dim ColorRed As Boolean
Dim ColorRowRed As Boolean
Set WS = Worksheets.Add

WS.Range("A1:D10").BorderAround xlSolid, xlThick, 6
For Each R In Range("A1:D10").Rows
ColorRowRed = Not ColorRowRed
ColorRed = ColorRowRed
For Each Rng In R.Cells
If ColorRed = True Then
Rng.Interior.ColorIndex = 3
Else
Rng.Interior.ColorIndex = 4
End If
ColorRed = Not ColorRed
Next Rng
Next R


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"MarkJones" wrote in
message ...

This is probably very easy to do, however I've got no clue as

to what
I'm doing...

Basically I need to program a macro to do the following...

1. Create a new Sheet in an Excel Workbook
2. Draw a grid from Cells A:1 to D:10
3. Format the grid with thick lined borders in Yellow
4. Colour each cell with alternate Red and green colours.

Now I've made an effort and I've got 1 done (I think)

Insert New WorkSheet

Any help would be really appriciated as this is very important

that I
actually complete this.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie needs help


Right I've done as you said

Sub Excel Test()

Sheets("Sheet1").Select
Sheets.Add
Range("A1:D10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With

Range("A1,C1,B2,D2,C3,A3,B4,D4,C5,A5,B6,D6,C7,A7,B 8,D8,C9,A9,B10,D10").Select
Range("D10").Activate
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With

Range("A2,B1,B3,C2,D1,D3,C4,D5,C6,D7,C8,D9,C10,B9, A10,A8,B7,A6,B5,A4").Select
Range("A4").Activate
Selection.Font.ColorIndex = 4
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Range("E11").Select
End Sub

Does that require cleaning in any way? Or would that be acceptable yo
think

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.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
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Can you help a NEWBIE please flub Excel Discussion (Misc queries) 11 January 11th 06 01:58 AM
Very very new newbie Thalia Took New Users to Excel 1 September 29th 05 04:13 AM
Help for a newbie? rehr0001 Excel Worksheet Functions 4 August 18th 05 05:13 AM
JET dB Newbie Needs Help Trip Excel Discussion (Misc queries) 0 August 15th 05 07:02 PM


All times are GMT +1. The time now is 01:05 AM.

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"