Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Copy to a mid column range Row 10 - Row 20

Trying to convet the commented out line to copy to row 10 and offset from there on down to row 20.

Assumes there is data in the rows above 10 and below 20, so my availsble range to copy is between 10 to 20.

The "FERow" part of a previous code I failed to properly add instructive comments about and thus I need some redirection.

Thanks,
Howard


Sub CopyToRange_ArrOut()
Dim arrOut As Variant
arrOut = Range("C12:F12")


' FERow = WorksheetFunction.Max(10, .Cells(20, 1).End(xlUp).Offset(1, 0).Row)
' .Cells(FERow, 1).Resize(columnsize:=4) = arrOut


Cells(Rows.Count, "C").End(xlUp)(2) _
.Resize(columnsize:=Range("C2:F2").Columns.Count) = arrOut

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Copy to a mid column range Row 10 - Row 20

Hi Howard,

Am Sun, 27 Jul 2014 23:17:06 -0700 (PDT) schrieb L. Howard:

Trying to convet the commented out line to copy to row 10 and offset from there on down to row 20.

Assumes there is data in the rows above 10 and below 20, so my availsble range to copy is between 10 to 20.


what range do you want to copy? Where should the data be pasted?
Do you want to copy the C12:F12 to column Q? Then try:

Sub CopyToRange_ArrOut()
Dim arrOut As Variant
Dim FERow As Long

With Sheets("Sheet1")
arrOut = .Range("C12:F12")

FERow = WorksheetFunction.Max(10, .Cells(20,
"Q").End(xlUp).Offset(1, 0).Row)
If IsEmpty(.Cells(FERow, "Q")) Then
.Cells(FERow, "Q").Resize(columnsize:=4) = arrOut
End If
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Copy to a mid column range Row 10 - Row 20

Hi Claus,

what range do you want to copy? Where should the data be pasted?

Do you want to copy the C12:F12 to column Q? Then try:


Sorry Claus, should have given some ranges.

I did not have any specific copy need, just wanted a working example of the mid range column target.

As I read the code, It looks to see if Q10 is blank and if it is blank then copy to Q10 otherwise offset from previous copy.

Works great.

Thanks a bunch.

Howard



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Copy to a mid column range Row 10 - Row 20

Hi Howard,

Am Mon, 28 Jul 2014 00:18:13 -0700 (PDT) schrieb L. Howard:

I did not have any specific copy need, just wanted a working example of the mid range column target.

As I read the code, It looks to see if Q10 is blank and if it is blank then copy to Q10 otherwise offset from previous copy.


the IF-statement is superfluous:

Sub CopyToRange_ArrOut()
Dim arrOut As Variant
Dim FERow As Long

With Sheets("Sheet1")
arrOut = .Range("C12:F12")

FERow = WorksheetFunction.Max(10, .Cells(20,
"Q").End(xlUp).Offset(1, 0).Row)
.Cells(FERow, "Q").Resize(columnsize:=4) = arrOut

End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Copy to a mid column range Row 10 - Row 20

On Monday, July 28, 2014 12:35:44 AM UTC-7, Claus Busch wrote:
Hi Howard,



Am Mon, 28 Jul 2014 00:18:13 -0700 (PDT) schrieb L. Howard:



I did not have any specific copy need, just wanted a working example of the mid range column target.




As I read the code, It looks to see if Q10 is blank and if it is blank then copy to Q10 otherwise offset from previous copy.




the IF-statement is superfluous:



Sub CopyToRange_ArrOut()

Dim arrOut As Variant

Dim FERow As Long



With Sheets("Sheet1")

arrOut = .Range("C12:F12")



FERow = WorksheetFunction.Max(10, .Cells(20,

"Q").End(xlUp).Offset(1, 0).Row)

.Cells(FERow, "Q").Resize(columnsize:=4) = arrOut



End With

End Sub





Regards

Claus B.

--

Vista Ultimate / Windows7

Office 2007 Ultimate / 2010 Professional



Great.

Thanks again, Claus.

Howard


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy range if column N is empty ajm1949 Excel Programming 24 May 13th 10 05:00 AM
Copy all Rows If Column Value X within a Range Juan Excel Programming 6 February 26th 09 07:06 PM
Copy/Paste Column Issue Using a Range ALATL Excel Programming 2 September 11th 07 09:46 PM
copy cells to end of range in other column Eric_G Excel Programming 3 August 17th 07 12:58 PM
copy a range with known start column to variable end column Matilda Excel Programming 2 August 2nd 06 04:55 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"