Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - Format Spreadsheet
One way to do #1:
Option Explicit Sub testme01() Dim rngSearch As Range Dim rngFound As Range With Worksheets("sheet1") Set rngSearch = .Cells 'or .range("a:a") or .range("a:e") With rngSearch Do Set rngFound = .Find("premium", LookIn:=xlValues, _ lookat:=xlWhole, searchdirection:=xlNext, _ MatchCase:=False) If rngFound Is Nothing Then Exit Do Else rngFound.EntireRow.Delete End If Loop End With End With End Sub And for #2. It's probably easiest to just record a macro when you do it manually. Select your range, then Data|sort After the sort, select the range, then Data|Subtotals It won't insert two blank rows, but using excel's builtin functions may make your life a lot easier. ACase wrote: Hello, I want to format a spreadsheet and need to do 2 things via a macro. 1) Search for a particular string "Premium" and delete all rows with this value 2) Sort on 3 fields (Underlying, Trade Type, and BuySell) add two blank lines whenver there is a change in the above three, and subtotal on Position. Any help would be much appreciated. Thanks ACase -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to copy and append spreadsheet changes to new spreadsheet | Excel Discussion (Misc queries) | |||
Format Spreadsheet | Excel Discussion (Misc queries) | |||
Excel Form Format to Spreadsheet Format | Excel Discussion (Misc queries) | |||
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? | Excel Discussion (Misc queries) | |||
Macro to save excel XP spreadsheet to excel 97 spreadsheet format | Excel Programming |