Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statement moving rows

Status
Not open for further replies.

hockeyman9474

IS-IT--Management
Oct 11, 2007
17
US
I pretty good with the basics of Excel. My boss has me doing something now, i'm not experienced doing. Here is what I need:

I have a monthly .txt file. I import the information into excel. One column has a page number. I sort by that column. I have a worksheet for each page number. I need to take all the rows up until the next page number and move them to the respective worksheet. I have been fumbling around with functions. I have figured out the if function. I canconcatenate and sum etc. I haven't quite figured out how to determine when the page number changes and how to cut all lines up until that point and move them to another worksheet.

Can someone point me in the right direction?


Thanks
Adam
 
Breaking up data by day/month/year/etc. is a very common mistake of Excel newcomers. I used to do it myself.

But it is a TERRIBLE idea.

Store all of the data on a single sheet. It will make reporting so much easier later on.

If you are worried about having things print correctly, use a macro to place page breaks at each change in the "page number" column.

If you are not familiar with macros, post a question in forum707. Then, while you are waiting for an answer, read faq707-5758 so you'll know what to do with any code snippets folks offer up.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
thanks john. let me throw this out there as well. each page number has certain account numbers associated with it as well. I need to seperate pages and row will be a header with the account numbers. I have a worksheet for each page with the account numbers in row 1 across the top. I will take the $ ammount for each entry and invert the column to be a row. I then need to import into access. Your suggestion seems logical if the account numbers remainedthe same on each page..
Adam
 




Adam,

May I echo John's response. Chopping source data up into separate chunks is a horrible practice.

With all your data properly formatted in a single table (sheet), you will be able to do ALL that your boss wants and more by using the reporting features of Excel.



Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top