View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gemz Gemz is offline
external usenet poster
 
Posts: 86
Default Macro for multiple tasks

Hi Mike,

I tried the addition you suggested but i get 'error 400'.

any ideas why this may be?

thanks

"Mike Fogleman" wrote:

Add this to the start of the macro:

Columns("I:I").Insert
Cells(1, 9).Value = "Day of Week"
Columns("I:I").AutoFit

Mike F
"Gemz" wrote in message
...
Hi,

Thanks for quick response, i tried the macro and it didnt work as required
becaues of some details i left out in the previous message!

To begin with column H is already populated, i should have said i need
column H (including its heading cell) moving into column I and then i want
the ddd format entered into column H..also it needs a new header cell
called
'day of week'..

thanks..



"Gary''s Student" wrote:

Here are the first two parts:

Sub genz()
Set ra = ActiveSheet.UsedRange
Set g = Range("G:G")
Set r = Intersect(ra, g)
For Each rr In r
If IsDate(rr) Then
rr.Offset(0, 1).Value = Format(rr.Value, "ddd")
End If
Next
Cells.Select
Selection.Sort Key1:=Range("H1"), Order1:=xlAscending, Header:=xlNo
End Sub
--
Gary''s Student - gsnu200820


"Gemz" wrote:

I have a series of steps i need to code for a macro and don't even know
how
to start! Can anyone help please?

1- To the right hand side of column G (i.e. column H) take the date
from
column G which is in dd/mm/yyy y format and change to ddd format -
putting
this into column H (this should be applied to the whole column, at the
moment the column is 400 lines long but this can grow so its best not
to
specify).
2- Once the above is done, the whole sheet should be sorted by column H
(this is the ddd format cells)
3- The days of the week should be counted in some way and then the day
that
appears most should be highlighted (if i could get a table of results
somewhere then that would be brilliant!)
4- Msg box to appear telling user which day of the week is most
popular..


Appreciate your help.


Thanks.