i have a loop that determines the first blank row in a worksheet - it is as follows:
and what i want to do is paste a formula 11 rows after the last row contacting data so i am using the following:
problem is in the line where i say COUNT(B4:BX)
obviously i want X to represent the number of the last row containing data but it is coming out as the letter X in the formula.
what do i need to change to get the to get the formula to have the value of the variable X instead of the letter X?
Code:
x = 2
Sheets("eRehab_Download").Select
Range("A1").Select
Do While Not IsEmpty(Range("A" & x))
x = x + 1
Loop
and what i want to do is paste a formula 11 rows after the last row contacting data so i am using the following:
Code:
Range("B" & x + 11).Select
ActiveCell.Formula = "=COUNTA(B4:BX)"
problem is in the line where i say COUNT(B4:BX)
obviously i want X to represent the number of the last row containing data but it is coming out as the letter X in the formula.
what do i need to change to get the to get the formula to have the value of the variable X instead of the letter X?