UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Countif Vba The Range In One Sheet And Criteria For In Another., Any Version    
 
   
Sami
post Dec 11 2019, 02:43 PM
Post#1



Posts: 82
Joined: 3-April 19



Hi
I tried this code:
In changeselection event
CODE
If target.column = 12 then
sheets("sheet2").range("m1") = _
Application.WorksheetFunction.countif(Sheets("sheet2").Range("h1:h"& Sheets("sheet2").cells(Rows.count,1).End(Xlup).Row),Sheets("sheet1").Range("t" & target.row))
End if

but it gives an error.
Thanks .
This post has been edited by Sami: Dec 11 2019, 02:45 PM
Go to the top of the page
 
Debaser
post Dec 13 2019, 06:08 AM
Post#2



Posts: 169
Joined: 11-October 18



What error does it give you?
Go to the top of the page
 
Sami
post Dec 16 2019, 06:06 AM
Post#3



Posts: 82
Joined: 3-April 19



I used range function in in this way:
Range(range("h1),range("h" &Sheets("sheet2").cells(Rows.count,1).End(Xlup).Row))
That makes the error.
I am sorry I must mention that after I correct the code in the question.
Go to the top of the page
 
Debaser
post Dec 17 2019, 08:04 AM
Post#4



Posts: 169
Joined: 11-October 18



You still didn't say what the error is?
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th January 2020 - 05:26 AM