Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Write code to insert multiple lines
Hi....
I have a spreadsheet that I need to do the following to 1. Find all projects in Column C, sort by project number 2. Insert 4 lines between each project category (there could be 1 to any number of different categories) 3. Add debits and credits for each project number (in the debit and credit column) on the second inserted line 4. After the debits and credits have been added in each column, then take the credit total and subtract the debit total on the next line... Here is example of what spreadsheet looks like: Col.A Col. B Col. C Col. D Col E(debit) Col. F 228 ,35108380 F05AX13599 74786000177 0 27.23 228 ,35108377 F05AX13599 74786000252 0 83.97 228 ,35108376 M04GX13503 44446000252 0 22.14 228 ,35108376 M04GX13503 44447000252 0 192.5 and there are more columns, but nothing needs to be done with them Here is a copy of the code I have so far... ' Columns("C:C").Find(What:="x").EntireRow.Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlToRight)).Select Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Columns("C:C").Find(What:="M0").EntireRow.Select In this code, I am finding "x" because that denotes a project account, (also have accts that are not related to projects). I was looking for M0 because that would be the next project category after F, and since it is sorted already, that would always be next...problem is, I might have M04, M05, F04, F05...etc... Any ideas how I can get this to do the steps I listed above? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert a symbol BEFORE text for multiple cells in Excel? | Excel Worksheet Functions | |||
Write a code by code | Excel Discussion (Misc queries) | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
Will pay someone to write small event code for me!! | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel |