View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Copy to the rows between 49 up to 29

Hi Howard,

Am Fri, 31 Jul 2015 04:50:29 -0700 (PDT) schrieb L. Howard:

With wksTarget
FERow = WorksheetFunction.Max(29, .Cells(49, 1).End(xlUp).Offset(1, 0).Row)
.Cells(FERow, 1).Resize(columnsize:=4) = varRicho
End With


I remember but I cannot find it in the archive.
Here a snippet with array. If the array has more items than 21 the items
will then written to column B and so on:

Sub Test()
Dim FERow As Long, i As Long, myCol As Long
Dim varData As Variant

With ActiveSheet
varData = .Range("E1:E30")
myCol = 1
For i = LBound(varData) To UBound(varData)
FERow = WorksheetFunction.Max(29, .Cells(49,
myCol).End(xlUp).Offset(1, 0).Row)
.Cells(FERow, myCol) = varData(i, 1)
If i = 22 Then
myCol = myCol + 1
End If
Next
End With
End Sub

If that's not the expected suggestion please explain a little further.
What do you want to copy? A single cell or a range? What should happen
if the range has more than 21 items?


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional