LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Copy to the rows between 49 up to 29

On Friday, July 31, 2015 at 7:50:02 AM UTC-7, Claus Busch wrote:
Hi again,

Am Fri, 31 Jul 2015 16:30:03 +0200 schrieb Claus Busch:

try it with:

Sub Copy()


better try:

Sub Copy()
Dim FERow As Long, LRow As Long, LCol As Long
Dim c As Range

With ActiveSheet
FERow = WorksheetFunction.Max(29, .Cells(Rows.Count,
1).End(xlUp).Offset(1, 0).Row)
If FERow 49 Then
MsgBox "Exceeding Range"
Exit Sub
End If
LRow = .Cells(Rows.Count, 5).End(xlUp).Row
Set c = .Range("E1:E" & LRow).Find("eex4", LookIn:=xlValues,
lookat:=xlWhole)
If Not c Is Nothing Then
LCol = .Cells(c.Row, Columns.Count).End(xlToLeft).Column
.Cells(FERow, 1).Resize(columnsize:=LCol - 4).Value = _
.Range(.Cells(c.Row, 5), .Cells(c.Row, LCol)).Value
End If
End With
End Sub


This works quite well, and I will keep the other non array code also. I did have to change this If FERow = 50 Then to If FERow < 50 Then.

I assume that was a typo, as it works in the brief test I did.

Good stuff, as always, I thank you Claus.

I'll be sure to make sufficient notes on these codes, and with the whole macros intact in a workbook example that will help.

Thanks again.

Howard




 
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 rows from one worksheet automatically, ignore rows that are b Kris Excel Worksheet Functions 2 October 10th 08 09:28 PM
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows Corey Excel Programming 2 August 1st 07 02:02 AM
Copy rows of data (eliminating blank rows) from fixed layout Sweepea Excel Discussion (Misc queries) 1 March 13th 07 11:05 PM
Find all rows of a color and copy those rows to a new worksheet hshayh0rn Excel Programming 3 May 26th 06 08:34 PM
Copy Rows and insert these rows before a page break AQ Mahomed Excel Programming 0 June 8th 04 09:09 AM


All times are GMT +1. The time now is 04:23 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"