Maintaining a ledger book

raj0007

New Member
Joined
Jun 23, 2016
Messages
31
Hello everyone I need a Help from all pro to create excel sheet for maintaining a ledger book which picks the data from single sheet cash data entry. like

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
3/1/19cash5200
3/1/19bansal 271700
3/1/19goyal 452000
3/1/19nanu453000
4/1/19mahinder3000
4/1/19vishal mohali ph12000
5/1/19hemraj ph13500
7/1/19satpal ph115000
8/1/19max 526700

<tbody>
</tbody>

all these entries to be sorted in the respective ledger account autofill. along with date. kindly help me out
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Re: Need help to create a excel for maintaining a ledger book

Hello,

You need to be a bit more descriptive. Where is the source data? Where is there destination for the data? What are the rules determining the sort into respective accounts?
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

hi sir the source of data is manual . and the destination of data is the sheet which is as per the column number 2 which belongs to the person account. and the sort is as per the column number 2 which is is the name of the account and copy the whole row and paste into the account sheet which can be renamed as per column no.2.
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

Hello,

This code assumed column N is available. If not change to a different column.

Code:
Sub COPY_TO_SHEETS()
    Application.ScreenUpdating = False
    Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("N1"), Unique:=True
    MY_SOURCE = ActiveSheet.Name
    For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
        Sheets.Add After:=Sheets(Sheets.Count)
        ActiveSheet.Name = Sheets(MY_SOURCE).Range("N" & MY_SHEETS).Value
    Next MY_SHEETS
    Sheets(MY_SOURCE).Select
    For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
        Range("A1:C1").Select
        Selection.AutoFilter
        ActiveSheet.Range("$A$1:$C$" & Range("B" & Rows.Count).End(xlUp).Row).AutoFilter Field:=2, Criteria1:=Range("N" & MY_SHEETS).Value
        Range("A2:C" & Range("B" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy
        Sheets(Range("N" & MY_SHEETS).Value).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteAll)
    Next MY_SHEETS
    Selection.AutoFilter
    Columns("N:N").ClearContents
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

thanks alot sir for help let me figure out if I am able to implement it.
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

Thanks alot sir for my help this is what I need exactly.. but sir I am not able to add further data it works only for the sample data which I shared
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

Can any one help me to fixed the code. as it work on the final data if I add further data it is not reflecing that I need it will also filter automatically that from next row onwards so that whenever I add more data after putting this code it will also incluse that data I just only need to refresh that by clicking the button...Sub COPY_TO_SHEETS()
Application.ScreenUpdating = False
Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("N1"), Unique:=True
MY_SOURCE = ActiveSheet.Name
For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = Sheets(MY_SOURCE).Range("N" & MY_SHEETS).Value
Next MY_SHEETS
Sheets(MY_SOURCE).Select
For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
Range("A1:C1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$C$" & Range("B" & Rows.Count).End(xlUp).Row).AutoFilter Field:=2, Criteria1:=Range("N" & MY_SHEETS).Value
Range("A2:C" & Range("B" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy
Sheets(Range("N" & MY_SHEETS).Value).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteAll)
Next MY_SHEETS
Selection.AutoFilter
Columns("N:N").ClearContents
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

Hello,

How about deleting all the sheets first?

Code:
Sub COPY_TO_SHEETS()
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    For MY_SHEETS = Sheets.Count To 2 Step -1
        Sheets(MY_SHEETS).Delete
    Next MY_SHEETS
    Application.DisplayAlerts = True
    Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("N1"), Unique:=True
    MY_SOURCE = ActiveSheet.Name
    For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
        Sheets.Add After:=Sheets(Sheets.Count)
        ActiveSheet.Name = Sheets(MY_SOURCE).Range("N" & MY_SHEETS).Value
    Next MY_SHEETS
    Sheets(MY_SOURCE).Select
    For MY_SHEETS = 1 To Range("N" & Rows.Count).End(xlUp).Row
        Range("A1:C1").Select
        Selection.AutoFilter
        ActiveSheet.Range("$A$1:$C$" & Range("B" & Rows.Count).End(xlUp).Row).AutoFilter Field:=2, Criteria1:=Range("N" & MY_SHEETS).Value
        Range("A2:C" & Range("B" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy
        Sheets(Range("N" & MY_SHEETS).Value).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteAll)
    Next MY_SHEETS
    Selection.AutoFilter
    Columns("N:N").ClearContents
    Application.ScreenUpdating = True
End Sub

Is this acceptable?
 
Upvote 0
Re: Need help to create a excel for maintaining a ledger book

Thanks alot sir for this help but when I refresh the data the row which I inserted in other sheets also get deleted . Is it possible to do ??
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top