#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro subprocedure

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 461
Default Macro subprocedure

You can easily accomplish this without using a macro... in the column or rows
where you recieve the #VALUE error try using an If(Iserror) statement. So if
you have a formula like

=A1/B1

If B1 is 0 you will get an error... but to fight that you would put

=If(Iserror(A1/B1),"No Info",A1/B1)

So basically you are just wrapping your current formula in the Iserror(). So
if an error pops up it will write in "No Info"

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro subprocedure

Thanks for your reply. The problem is that I am using the formula
=NETWORKDAYS(G8,H8). Then a macro will copy this formula all the way down in
the column until there is data available. In some rows, there G or H is
empty and then I get the error mesage. I need to use a macro. Could you
help me with ti please

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 461
Default Macro subprocedure

You want to post the macro?

Also try

=If(Iserror(Networkdays(G8,H8),"No Info",Networkdays(G8,H8))

"orquidea" wrote:

Thanks for your reply. The problem is that I am using the formula
=NETWORKDAYS(G8,H8). Then a macro will copy this formula all the way down in
the column until there is data available. In some rows, there G or H is
empty and then I get the error mesage. I need to use a macro. Could you
help me with ti please

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro subprocedure

Yes, I tried you formula with NETWORKDAYS and worked. I am trying to put
that into a macro. Let see.
Below is the original macro I did.

Range("O2").Select
Do
If ActiveCell.Value = "#VALUE!" Then
ActiveCell.Value = "No Info"
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Offset(0, -13) = ""


I also would like to know how could I say
If ActiveCell.Value = any number then
ActiveCell.Offset(1,0)

Thanks
Orquidea

"akphidelt" wrote:

You want to post the macro?

Also try

=If(Iserror(Networkdays(G8,H8),"No Info",Networkdays(G8,H8))

"orquidea" wrote:

Thanks for your reply. The problem is that I am using the formula
=NETWORKDAYS(G8,H8). Then a macro will copy this formula all the way down in
the column until there is data available. In some rows, there G or H is
empty and then I get the error mesage. I need to use a macro. Could you
help me with ti please

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 461
Default Macro subprocedure

You can also use the IsError formula in code... so your macro can be

Range("O2").Select
Do Until ActiveCell.Offset(0, -13) = ""
If IsError(ActiveCell.Value) Then
ActiveCell.Value = "No Info"
End If
ActiveCell.Offset(1,0).Activate
Loop

To check for numbers you can use

If IsNumeric

"orquidea" wrote:

Yes, I tried you formula with NETWORKDAYS and worked. I am trying to put
that into a macro. Let see.
Below is the original macro I did.

Range("O2").Select
Do
If ActiveCell.Value = "#VALUE!" Then
ActiveCell.Value = "No Info"
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Offset(0, -13) = ""


I also would like to know how could I say
If ActiveCell.Value = any number then
ActiveCell.Offset(1,0)

Thanks
Orquidea

"akphidelt" wrote:

You want to post the macro?

Also try

=If(Iserror(Networkdays(G8,H8),"No Info",Networkdays(G8,H8))

"orquidea" wrote:

Thanks for your reply. The problem is that I am using the formula
=NETWORKDAYS(G8,H8). Then a macro will copy this formula all the way down in
the column until there is data available. In some rows, there G or H is
empty and then I get the error mesage. I need to use a macro. Could you
help me with ti please

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro subprocedure

Thanks for your help. It worked.

"akphidelt" wrote:

You can also use the IsError formula in code... so your macro can be

Range("O2").Select
Do Until ActiveCell.Offset(0, -13) = ""
If IsError(ActiveCell.Value) Then
ActiveCell.Value = "No Info"
End If
ActiveCell.Offset(1,0).Activate
Loop

To check for numbers you can use

If IsNumeric

"orquidea" wrote:

Yes, I tried you formula with NETWORKDAYS and worked. I am trying to put
that into a macro. Let see.
Below is the original macro I did.

Range("O2").Select
Do
If ActiveCell.Value = "#VALUE!" Then
ActiveCell.Value = "No Info"
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Offset(0, -13) = ""


I also would like to know how could I say
If ActiveCell.Value = any number then
ActiveCell.Offset(1,0)

Thanks
Orquidea

"akphidelt" wrote:

You want to post the macro?

Also try

=If(Iserror(Networkdays(G8,H8),"No Info",Networkdays(G8,H8))

"orquidea" wrote:

Thanks for your reply. The problem is that I am using the formula
=NETWORKDAYS(G8,H8). Then a macro will copy this formula all the way down in
the column until there is data available. In some rows, there G or H is
empty and then I get the error mesage. I need to use a macro. Could you
help me with ti please

"orquidea" wrote:

Hi All

Could anyone please help me to write a subprocedure wich replace the cell
with the error note #VALUE! with the comment "No Info"
I have the below

If ActiveCell.Value = numero (I don' know how to tell the computer
that any number is valid) Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Value = "No Info"
End If

Thanks,
Orquidea


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
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
Hyperlink to a subprocedure in an other workbook LimaB Excel Worksheet Functions 0 July 20th 06 08:35 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"