Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tuesday, October 15, 2013 1:22:32 PM UTC-7, Claus Busch wrote:
Hi Howard, Am Tue, 15 Oct 2013 13:16:03 -0700 (PDT) schrieb Howard: Sheets(arrSh(i)).Cells(Rows.Count, "M").End(xlUp) _ .Offset(1, 0).Resize(1, 13) = varOut at the beginning of the code is the line with With Sheets(ArrSh(i)) so the .Cells(Rows.Count, "M").End(xlUp) _ .Offset(1, 0).Resize(1, 13) = varOut is enough. Another suggestions with Select Case: Sub Test2() Dim arrSh As Variant Dim i As Integer Dim rngC As Range Dim varOut As Variant Dim myTarget As Range Application.ScreenUpdating = False arrSh = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4") For i = LBound(arrSh) To UBound(arrSh) With Sheets(arrSh(i)) For Each rngC In .Range("AU1:AU10") Select Case rngC.Value Case "W" varOut = rngC.Offset(0, 16).Resize(1, 13) Set myTarget = .Cells(Rows.Count, "M") _ .End(xlUp).Offset(1, 0) Case "P" varOut = rngC.Offset(0, 16).Resize(1, 13) Set myTarget = .Cells(Rows.Count, "AA") _ .End(xlUp).Offset(1, 0) End Select myTarget.Resize(1, 13) = varOut Next End With Next Application.ScreenUpdating = True End Sub Regards Claus B. -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 Got a bunch of workable codes!! Thanks, Claus and Harald. Appreciate it. Regards, Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case code error | Excel Programming | |||
Clean this select case code up a bit. | Excel Programming | |||
Code not working, copy in Select Case section not copying over. | Excel Programming | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
Simplify Code - Select Case | Excel Programming |