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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

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,691
Messages
5,488,293
Members
407,633
Latest member
varunwalla

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top