Hello. Happy Friday!
I have a sheet that I need to loop through all cells in a column and count the total number of cells that contain data (will always be text in cells) & put the total number in the cell after the last cell that contains data. The cells in question are in column A and my sheet does contain a header that does not need to be included in the count. My sheet contains data from columns A to Z.
Can the below vba be changed some to accomplish this? The coding here sums up all the numbers in cells and puts the answer in the cell after the last row w/ values (text and numbers). This code was provide to me via a mrexcel member (Fluff) and it works wonderfully. IDK if it can be altered to accomplish what I need the new code to do or if different vba coding would be the best way to go.
Code I'm currently using to sum up all numbers in a column & pasting answer in cell after last row that contains value via a command button:
With Range("Y" & Rows.Count).End(xlUp).Offset(1, -14) .FormulaR1C1 = "=sum(r2c:r[-1]c)"
.HorizontalAlignment = xlCenter
End With
I truly appreciate any assistance. Thank you so much!
Respectfully,
slivesay
I have a sheet that I need to loop through all cells in a column and count the total number of cells that contain data (will always be text in cells) & put the total number in the cell after the last cell that contains data. The cells in question are in column A and my sheet does contain a header that does not need to be included in the count. My sheet contains data from columns A to Z.
Can the below vba be changed some to accomplish this? The coding here sums up all the numbers in cells and puts the answer in the cell after the last row w/ values (text and numbers). This code was provide to me via a mrexcel member (Fluff) and it works wonderfully. IDK if it can be altered to accomplish what I need the new code to do or if different vba coding would be the best way to go.
Code I'm currently using to sum up all numbers in a column & pasting answer in cell after last row that contains value via a command button:
With Range("Y" & Rows.Count).End(xlUp).Offset(1, -14) .FormulaR1C1 = "=sum(r2c:r[-1]c)"
.HorizontalAlignment = xlCenter
End With
I truly appreciate any assistance. Thank you so much!
Respectfully,
slivesay