Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Macro for multiple tasks

I have a series of steps i need to code for a macro and dont 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro for multiple tasks

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 dont 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Macro for multiple tasks

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 dont 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Macro for multiple tasks

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.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro for multiple tasks

You will clearly need to make adaptations of the code I posted to suit your
specific needs.

I can't see the complete structure of your worksheet, so I post demo code.
Even this demo code is incomplete.
--
Gary''s Student - gsnu200820


  #6   Report Post  
Posted to microsoft.public.excel.programming
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.




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
How to open multiple excel files as separate tasks on the taskbar? Bread Setting up and Configuration of Excel 6 October 12th 08 12:39 PM
What's An Easy Way To Establish Predecessor/Follower Relationship in Multiple Tasks At Once? Tom Charts and Charting in Excel 0 August 5th 07 01:30 AM
sending outlook tasks to multiple people [email protected] Excel Programming 0 February 15th 06 08:38 PM
Macro -- repetitive tasks OTS Excel Discussion (Misc queries) 1 October 7th 05 04:23 PM
Using macro to run repetitive tasks OTS Excel Discussion (Misc queries) 1 October 7th 05 01:37 PM


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