COUNTIF issue in my VBA (dynamic range needs fixing)
Hi, Brand Spanking new here! The problem with my code is my needing to use a For Next Loop Variable to specify the searching range within a VBA COUNTIF...
Dim x As Integer; Dim y As Integer; Dim FND As String;x = 0; y = 0; 'Put on 1 line here just so code all shows.
For x = 1 To 10
FND = Sheets("Sheet2").Cells(x, 3)
For y = 1 To 10
Sheets("Sheet2").Cells(x, 4) = "=COUNTIF('Sheet1'!y:y, """ & FND & """)"
Next y;
Next x;'So it's the y:y in the COUNTIF that beenabout 11 hours straight now! My intention is for it to be a range of 1:1 then with next y it to be 2:2 and so on.
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago