Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please Correct the mistake

I have this formula in a macro.

If sh2Row = 30 Then
sh2.Cells(32, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C3 0"), 0)
End If

It gives me error. Please Help

Thanks & Regards.



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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Please Correct the mistake

On Sat, 1 Nov 2003 02:56:39 -0500, Michael168
wrote:

It usually helps when you state what the error IS.

The code works fine for me. Things to check:
- How is the variable sh2Row being populated? Are you sure that it
contains a valid value?
- Are you sure that you have a sheet's CODE NAME, not its NAME, set as
sh2? (As in the line "sh2.Cells(32, 3).Value"). Look in the Project
Explorer of the Visual Basic Editor. (You can turn it on through the
View menu if you can't see it.) Turn on the Properties window. Select
the relevant worksheet in the Project Explorer, and make sure that the
Property shown as (Name) (that is, the one with the brackets around
it) is sh2. If it's not, that's your problem.

I have this formula in a macro.

If sh2Row = 30 Then
sh2.Cells(32, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C 30"), 0)
End If

It gives me error. Please Help



---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Please Correct the mistake

it appears that you are missing a dot between sh2 and row
should be sh2.Row, otherwise it's interpreted as a variable "sh2row" which
you don't have

RADO


"Michael168" wrote in message
...
I have this formula in a macro.

If sh2Row = 30 Then
sh2.Cells(32, 3).Value = _
Application.WorksheetFunction.CountIf(Range("C1:C3 0"), 0)
End If

It gives me error. Please Help

Thanks & Regards.



------------------------------------------------
~~ 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
where is the mistake? xavi garriga Excel Discussion (Misc queries) 8 September 24th 07 12:06 PM
mistake in formula pm Excel Discussion (Misc queries) 4 January 30th 06 05:31 PM
I saved it by mistake!!!! Ellie Ellis Excel Worksheet Functions 2 November 27th 05 09:40 PM
Found Mistake can't correct. dvonj Excel Worksheet Functions 7 March 21st 05 08:11 PM
If I get the help box up by hitting F1 by mistake, how can I get . Last1Standin Excel Discussion (Misc queries) 1 February 17th 05 08:56 PM


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