Claculate no of rows in a sheet and add deficient no of rows

ankit13

New Member
Joined
Aug 21, 2014
Messages
14
Hi,

I have a sheet where no of rows are 90 and I want to a VBA code which:
1. Check the no of rows in the sheet
2. if the no of rows are less than 90 then add deficient no of rows below row no 68.

I will be adding the above code in my current code, therefore please send a very simple code.

Please help.!!!
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

ParamRay

Well-known Member
Joined
Aug 6, 2014
Messages
1,195
Hi,

I have a sheet where no of rows are 90 and I want to a VBA code which:
1. Check the no of rows in the sheet
2. if the no of rows are less than 90 then add deficient no of rows below row no 68.

I will be adding the above code in my current code, therefore please send a very simple code.

Please help.!!!

The number of rows in a worksheet is fixed (normally at 1,048,576 rows).

Please can you clarify what you mean?
 

Oeldere

Well-known Member
Joined
Dec 29, 2011
Messages
2,213
Probably I can't help you enough with your question.

though the question is very poor with information.

A sheet always has 90 rows in it.

you need to add e.g. the information on which column(s) the count is related.

you have headers also / they also have to count for the number of 90 rows?
 

ankit13

New Member
Joined
Aug 21, 2014
Messages
14
sorry for the poor question
I meant the no of filled/used rows is 90 and other rows I am not using.
 

ankit13

New Member
Joined
Aug 21, 2014
Messages
14
one more thing which i forgot to mention that on the last (90th) row, there is a text, so you can take the count from row 1 to the row containing the note (which i want to be 90 rows)
 

Oeldere

Well-known Member
Joined
Dec 29, 2011
Messages
2,213
Code:
you need to add e.g. the information on which column(s) the count is related.

you have headers also / they also have to count for the number of 90 rows?
why no answers to this questions?
 

ankit13

New Member
Joined
Aug 21, 2014
Messages
14
found it
code: Do Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If LR <> 90 Then Range("70:70").Insert Shift:=xlDown
Loop Until LR = 90:
 

Watch MrExcel Video

Forum statistics

Threads
1,102,351
Messages
5,486,351
Members
407,541
Latest member
Emilybuhman

This Week's Hot Topics

Top