Posts Tagged ‘row’

This is the opposite tutorial of the Convert Matrix to Vector tutorial. The following function takes a single row vector and converts into a matrix: Function Create_Matrix(Vector_Range As Range, No_Of_Cols_in_output As Integer, No_of_Rows_in_output As Integer) As Variant ReDim Temp_Array(No_Of_Cols_in_output, No_of_Rows_in_output) Dim No_Of_Elements_In_Vector As Integer Dim Col_Count As Integer, Row_Count As Integer Dim Cell No_Of_Elements_In_Vector = […]

Saturday, October 18th, 2008 at 08:53 | 6 comments
Categories: VBA

Imagine that we have 20,000 rows of data in an Excel spreadsheet: However, what about if you wanted to cut this data down such as take every 5th row ? This article shows how it can be done. The Row() function gives the number of each row: The mod function allows us to perform modulo […]

Friday, September 12th, 2008 at 13:41 | 0 comments
Tags: , , , ,

Do you have to run a loop down a sheet but don’t know where the data stops? ActiveSheet.UsedRange.Rows.Count might help. 1. Put this in a module Sub LastRow() Dim LastRow As Integer LastRow = ActiveSheet.UsedRange.Rows.Count MsgBox LastRow End Sub

Saturday, August 14th, 2004 at 00:10 | 1 comment
Tags: ,
TOP