ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   transfer data? lookup? (https://www.excelbanter.com/excel-worksheet-functions/203668-transfer-data-lookup.html)

GA85

transfer data? lookup?
 
Suppose Sheet 1 looks like this:

1 2340 Cash Received Payment 2,000
3578 Accounts Pay Received Payment 2,000

2 4590 Expense Pd. Rent 9,000
2340 Cash Pd. Rent
9,000

Now, on Sheet 2 I want all of the information to be categorized by the
account number (ex. 2340)

How do I do this????


ryguy7272

transfer data? lookup?
 
If I were you, I'd try to arrange these items into rows, using a space in a
row as an identifier:

Sub rearrange()

Dim curselection As Range
Dim i As Integer

Set curselection = Range("A1") 'or wherever you start

Do While curselection < ""

If Not curselection.Offset(1, 0) = "" Then
i = 1
Do
curselection.Offset(1, 0).Copy Destination:=curselection.Offset(0, i)
curselection.Offset(1, 0).EntireRow.Delete
i = i + 1
Loop Until curselection.Offset(1, 0) = ""
End If

curselection.Offset(1, 0).EntireRow.Delete
Set curselection = curselection.Offset(1, 0)

Loop

End Sub

Then Select the entire range, and then sort according to...probably Column
B...


Regards,
Ryan---

--
RyGuy


"GA85" wrote:

Suppose Sheet 1 looks like this:

1 2340 Cash Received Payment 2,000
3578 Accounts Pay Received Payment 2,000

2 4590 Expense Pd. Rent 9,000
2340 Cash Pd. Rent
9,000

Now, on Sheet 2 I want all of the information to be categorized by the
account number (ex. 2340)

How do I do this????



All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com