Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I see two different code examples from my site zero. If there is a way I can get this sorting script to just ignore ignore the cells with 0 in it (well just in the column I have specified to sort by.) If you have a zero in that column you can delete the sheet with 0 that is created ? -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Read it this weekend Kris Bedtime for me now -- Regards Ron de Bruin http://www.rondebruin.nl "Kris" wrote in message oups.com... Thanks for the answer Ron. This solution just crahses the workbook because the entire worksheet where there is no value is displayed as a zero. If there is a way I can get this sorting script to just ignore ignore the cells with 0 in it (well just in the column I have specified to sort by.) With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With With ws1 rng.Columns(10).AdvancedFilter _ Action:=xlFilterCopy, _ CopyToRange:=.Range("IV1"), Unique:=True 'This example filter on the first column in the range (change this if needed) 'You see that the last two columns of the worksheet are used to make a Unique list 'and add the CriteriaRange.(you can't use this macro if you use the columns) Lrow = .Cells(Rows.Count, "IV").End(xlUp).Row .Range("IU1").Value = .Range("IV1").Value For Each cell In .Range("IV2:IV" & Lrow) .Range("IU2").Value = cell.Value Set WSNew = Sheets.Add On Error Resume Next WSNew.Name = Left(cell.Value, Len(cell.Value) - 2) & Format(Val(Right(cell.Value, 2)) + 1, "00") If Err.Number 0 Then MsgBox "Change the name of : " & WSNew.Name & " manually" Err.Clear End If On Error GoTo 0 rng.AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=.Range("IU1:IU2"), _ CopyToRange:=WSNew.Range("A1"), _ Unique:=False WSNew.Columns.AutoFit Next .Columns("IU:IV").Clear End With With Application .ScreenUpdating = True .Calculation = CalcMode End With Thanks for all of the help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Column Width using Ron de Bruin script | Excel Discussion (Misc queries) | |||
Need help Editing Ron de Bruin Script | Excel Programming | |||
Ron de Bruin (ADO help) | Excel Programming | |||
Excel 2000/XP script to Excel97 script | Excel Programming | |||
for Ron de Bruin | Excel Programming |