Copy-Paste COUNTIF
Copy-Paste COUNTIF
(OP)
Hi,
I have data coming from another macro in this format
A B C D....n
1
2 A1 x x...
3 A2 x x x...
.....................
A(i) x x...
i+1 Q
In cell Q, I would like to put a COUNTIF formula to see how many times the x letter will appear and then copy-paste the formula in row i+1, column C up to n, all these things in a macro.
For a fixed value of i and n, I Know how to do it but for different values, I'm lost...
Thanks for the help.
I have data coming from another macro in this format
A B C D....n
1
2 A1 x x...
3 A2 x x x...
.....................
A(i) x x...
i+1 Q
In cell Q, I would like to put a COUNTIF formula to see how many times the x letter will appear and then copy-paste the formula in row i+1, column C up to n, all these things in a macro.
For a fixed value of i and n, I Know how to do it but for different values, I'm lost...
Thanks for the help.
Regards
Fernando





RE: Copy-Paste COUNTIF
Perhaps explain what you would do for a fixed i and n and then explain what you want the pasted formula to look like?
Read the Eng-Tips Site Policies at FAQ731-376: Eng-Tips.com Forum Policies
RE: Copy-Paste COUNTIF
Thanks for reply, I found the solution.
Instead of using for example
Range(A14:G14).Select
I have to use
myNum = Application.InputBox("Enter a number ")
k = myNum
rang = "B" & CStr(k)
rang1 = "R" & CStr(k)
Range(rang, rang1).Select
My problem was the comma between rang and rang1.....
Thanks anyway.
Regards
Fernando
RE: Copy-Paste COUNTIF
CODE
myNum = Application.InputBox("Enter a number ")
k = CLng(myNum)
Set r = Range(Cells(k, 2), Cells(k, 18))
CODE
Cheers,
Joerd
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Copy-Paste COUNTIF
Regards
Fernando