Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy rows from one worksheet automatically, ignore rows that are b | Excel Worksheet Functions | |||
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows | Excel Programming | |||
Copy rows of data (eliminating blank rows) from fixed layout | Excel Discussion (Misc queries) | |||
Find all rows of a color and copy those rows to a new worksheet | Excel Programming | |||
Copy Rows and insert these rows before a page break | Excel Programming |