PC Review


Reply
Thread Tools Rate Thread

cant see the macro

 
 
SangelNet
Guest
Posts: n/a
 
      1st Nov 2007
hi guys,

i have the following

Sub daterange(Optional today As Date)

today = Date

For Each cell In Worksheet("updated calls").Range("H:H")
If cell.Value <> "" Then
If cell.Value = today Then
sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
End If
End If
Next
If sStr <> "" Then
MsgBox sStr, , "message here"
End If
End Sub


Im trying to assign the macro to a button, but the nacro doesnt appear
in the macro list.

Any thoughts? thnx

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      1st Nov 2007
>>Sub daterange(Optional today As Date)

If you specify a parameter, even optional, the macro will not appear in the
list.

And since you have this:

today = Date

you're overriding it anyway so you might as well remove the parameter.

--
Jim
"SangelNet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| hi guys,
|
| i have the following
|
| Sub daterange(Optional today As Date)
|
| today = Date
|
| For Each cell In Worksheet("updated calls").Range("H:H")
| If cell.Value <> "" Then
| If cell.Value = today Then
| sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
| End If
| End If
| Next
| If sStr <> "" Then
| MsgBox sStr, , "message here"
| End If
| End Sub
|
|
| Im trying to assign the macro to a button, but the nacro doesnt appear
| in the macro list.
|
| Any thoughts? thnx
|


 
Reply With Quote
 
=?Utf-8?B?Sm9obiBCdW5keQ==?=
Guest
Posts: n/a
 
      1st Nov 2007
Save it in your Personal.xls workbook and you'll see it then. If you don't
have one, hit the record a macro button, select personal macro workbook from
the "Store macro in" drop down, do something, then stop recording, you will
now see it anytime you have the editor open, put your code in there.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"SangelNet" wrote:

> hi guys,
>
> i have the following
>
> Sub daterange(Optional today As Date)
>
> today = Date
>
> For Each cell In Worksheet("updated calls").Range("H:H")
> If cell.Value <> "" Then
> If cell.Value = today Then
> sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
> End If
> End If
> Next
> If sStr <> "" Then
> MsgBox sStr, , "message here"
> End If
> End Sub
>
>
> Im trying to assign the macro to a button, but the nacro doesnt appear
> in the macro list.
>
> Any thoughts? thnx
>
>

 
Reply With Quote
 
SangelNet
Guest
Posts: n/a
 
      1st Nov 2007
On Nov 1, 4:10 pm, "Jim Rech" <jrr...@hotmail.com> wrote:
> >>Sub daterange(Optional today As Date)

>
> If you specify a parameter, even optional, the macro will not appear in the
> list.
>
> And since you have this:
>
> today = Date
>
> you're overriding it anyway so you might as well remove the parameter.
>
> --
> Jim"SangelNet" <upslavazq...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
> | hi guys,
> |
> | i have the following
> |
> | Sub daterange(Optional today As Date)
> |
> | today = Date
> |
> | For Each cell In Worksheet("updated calls").Range("H:H")
> | If cell.Value <> "" Then
> | If cell.Value = today Then
> | sStr = sStr & cell.Offset(0, -6).Value & vbNewLine
> | End If
> | End If
> | Next
> | If sStr <> "" Then
> | MsgBox sStr, , "message here"
> | End If
> | End Sub
> |
> |
> | Im trying to assign the macro to a button, but the nacro doesnt appear
> | in the macro list.
> |
> | Any thoughts? thnx
> |


Thnx, That was it! fix in a jiff!!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Microsoft Excel Worksheet Functions 3 30th Oct 2009 11:41 AM
::: Sort macro with empty lines at the end. ::: Macro de tri avec lignes vide en bas. infojacques@gmail.com Microsoft Excel Discussion 2 5th Jul 2007 11:40 AM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor karll@swfab.com Microsoft Excel Programming 2 30th Mar 2007 07:48 PM
Run Macro On Open event for report and SetValue Macro has wierd error ThompsonJessical@yahoo.com Microsoft Access Macros 2 2nd Aug 2005 05:51 PM
Start Macro / Stop Macro / Restart Macro Pete Microsoft Excel Programming 2 21st Nov 2003 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:36 AM.