View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andoni[_3_] Andoni[_3_] is offline
external usenet poster
 
Posts: 1
Default SpecialCells used to enter data

'For sure there are many other ways, but i think this is the fastest
'one, mainly when the inputs in colum("B") increase

Sub Andoni()
Dim LastRow As Long
Dim Rng As Range
Dim RngData_1 As Variant
Dim RngData_2() As Variant
Dim X As Long

With ActiveSheet
.UsedRange 'Reset last Cell
'Gets the last non empty cell in ThisWorkSheet
LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
'Set a Range named Rng to the B column data rows
Set Rng = Range("B1", Cells(LastRow, "B"))
'Gets the range's Rng values to RngData_1
RngData_1 = Rng.Value
End With
'takes the proper arrays size
ReDim RngData_2(1 To UBound(RngData_1, 1), 1 To 1)
For X = 1 To UBound(RngData_1, 1)
If IsEmpty(RngData_1(X, 1)) = False Then
RngData_2(X, 1) = "Formula Here"
End If
Next X
'applies the desired "Formula"
Range("C1").Resize(UBound(RngData_1, 1), 1).Value
RngData_2

End Su

--
Message posted from http://www.ExcelForum.com