Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
parthaemail
 
Posts: n/a
Default countif usage in macro


if i give the function =countif(sheet1!E2:E12,"=Europe") in blank
shell of excel ,it gives no of rows having the word europe in the
column E . but if i give the same commend in macro it shows syntax
error .


Sub parthamacro()
'
' parthamacro Macro
' Macro recorded 2/8/2006 by 128304
'

'
Dim nResult As Long
nResult = sheet1.countif(sheet1!E2:E12,"=Europe")

End Sub


can you please help me , how to use countif function in macros


--
parthaemail
------------------------------------------------------------------------
parthaemail's Profile: http://www.excelforum.com/member.php...o&userid=31311
View this thread: http://www.excelforum.com/showthread...hreadid=510077

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default countif usage in macro

Dim myRng as range
dim nResult as long
set myrng = worksheets("sheet1").range("e2:E12")
nresult = application.countif(myrng,"europe")




parthaemail wrote:

if i give the function =countif(sheet1!E2:E12,"=Europe") in blank
shell of excel ,it gives no of rows having the word europe in the
column E . but if i give the same commend in macro it shows syntax
error .

Sub parthamacro()
'
' parthamacro Macro
' Macro recorded 2/8/2006 by 128304
'

'
Dim nResult As Long
nResult = sheet1.countif(sheet1!E2:E12,"=Europe")

End Sub

can you please help me , how to use countif function in macros

--
parthaemail
------------------------------------------------------------------------
parthaemail's Profile: http://www.excelforum.com/member.php...o&userid=31311
View this thread: http://www.excelforum.com/showthread...hreadid=510077


--

Dave Peterson
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 07:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 11:12 PM


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