RAJESH1960
Banned for repeated rules violations
- Joined
- Mar 26, 2020
- Messages
- 2,313
- Office Version
- 2019
- Platform
- Windows
Hello guys
I have a data in sheet Z which needs to be copied and pasted in sheet F in the last empty cell with the help of a code. In this sheet it is row 18, but how do I select the empty cell below the cell which contains data. If you run this code you will understand what I am trying to achieve.
Sub singleEntries()
' singleEntries Macro
Sheets("Z").Select
Range("B2:D2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
ActiveSheet.Paste
Range("H18").Select
Sheets("Z").Select
Range("E2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-3
Sheets("F").Select
ActiveSheet.Paste
Sheets("Z").Select
Range("F2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
Range("G18").Select
ActiveSheet.Paste
Sheets("Z").Select
Range("G2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
Range("I18").Select
ActiveSheet.Paste
Range("F17").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("F17:F18")
Range("F17:F18").Select
Selection.AutoFill Destination:=Range("F17:F37")
Range("F17:F37").Select
ActiveWindow.SmallScroll Down:=6
End Sub
I have a data in sheet Z which needs to be copied and pasted in sheet F in the last empty cell with the help of a code. In this sheet it is row 18, but how do I select the empty cell below the cell which contains data. If you run this code you will understand what I am trying to achieve.
Sub singleEntries()
' singleEntries Macro
Sheets("Z").Select
Range("B2:D2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
ActiveSheet.Paste
Range("H18").Select
Sheets("Z").Select
Range("E2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=-3
Sheets("F").Select
ActiveSheet.Paste
Sheets("Z").Select
Range("F2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
Range("G18").Select
ActiveSheet.Paste
Sheets("Z").Select
Range("G2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("F").Select
Range("I18").Select
ActiveSheet.Paste
Range("F17").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("F17:F18")
Range("F17:F18").Select
Selection.AutoFill Destination:=Range("F17:F37")
Range("F17:F37").Select
ActiveWindow.SmallScroll Down:=6
End Sub
Book3 | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Line | Date | Vch Type | Vch No. | Particulars | Debit | Credit | ||
2 | 6 | 02-07-2021 | Contra | 101 | Cash | -2000 | 2000 | ||
3 | 7 | 03-07-2021 | Contra | 102 | Cash | 25000 | -25000 | ||
4 | 19 | 07-07-2021 | Contra | 105 | Cash | -2000 | 2000 | ||
5 | 20 | 08-07-2021 | Contra | 106 | Cash | 25000 | -25000 | ||
6 | 27 | 12-07-2021 | Payment | 108 | January | 100 | -100 | ||
7 | 33 | 02-07-2021 | Contra | 110 | Cash | -2000 | 2000 | ||
8 | 34 | 03-07-2021 | Contra | 111 | Cash | 25000 | -25000 | ||
9 | 46 | 07-07-2021 | Contra | 114 | Cash | -2000 | 2000 | ||
10 | 47 | 08-07-2021 | Contra | 115 | Cash | 25000 | -25000 | ||
11 | 54 | 12-07-2021 | Payment | 117 | January | 100 | -100 | ||
12 | 60 | 02-07-2021 | Contra | 119 | Cash | -2000 | 2000 | ||
13 | 61 | 03-07-2021 | Contra | 120 | Cash | 25000 | -25000 | ||
14 | 73 | 07-07-2021 | Contra | 123 | Cash | -2000 | 2000 | ||
15 | 74 | 08-07-2021 | Contra | 124 | Cash | 25000 | -25000 | ||
16 | 81 | 12-07-2021 | Payment | 126 | January | 100 | -100 | ||
17 | 87 | 02-07-2021 | Contra | 128 | Cash | -2000 | 2000 | ||
18 | 88 | 03-07-2021 | Contra | 129 | Cash | 25000 | -25000 | ||
19 | 100 | 07-07-2021 | Contra | 132 | Cash | -2000 | 2000 | ||
20 | 101 | 08-07-2021 | Contra | 133 | Cash | 25000 | -25000 | ||
21 | 108 | 12-07-2021 | Payment | 135 | January | 100 | -100 | ||
Z |
Book3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | AP | AQ | AR | AS | AT | AU | AV | AW | AX | AY | AZ | BA | BB | BC | BD | BE | BF | BG | |||
1 | Help | Date | Voucher Type | Voucher No. | Narration | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Ledger Name | Dr(-), Cr(+) | Total | |||
2 | Matched | 30-06-2021 | Receipt | 100 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
3 | Matched | 04-07-2021 | Payment | 103 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
4 | Matched | 05-07-2021 | Receipt | 104 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
5 | Matched | 09-07-2021 | Payment | 107 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
6 | Matched | 30-06-2021 | Receipt | 109 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
7 | Matched | 04-07-2021 | Payment | 112 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
8 | Matched | 05-07-2021 | Receipt | 113 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
9 | Matched | 09-07-2021 | Payment | 116 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
10 | Matched | 30-06-2021 | Receipt | 118 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
11 | Matched | 04-07-2021 | Payment | 121 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
12 | Matched | 05-07-2021 | Receipt | 122 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
13 | Matched | 09-07-2021 | Payment | 125 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
14 | Matched | 30-06-2021 | Receipt | 127 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
15 | Matched | 04-07-2021 | Payment | 130 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
16 | Matched | 05-07-2021 | Receipt | 131 | Bank | -4040 | Sunday | 1015 | Monday | 2025 | Tuesday | 1000.5 | Round Off | -0.5 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||
17 | Matched | 09-07-2021 | Payment | 134 | Bank | 1001 | January | -100 | February | -200 | March | -300 | April | -400 | Round Off | -1 | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||
18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||||||||||||||||||||||||||
19 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||||||||||||||||||||||||||
20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
F |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:A37 | A2 | =IF(B2&C2&F2&G2&H2&I2="","",IF(OR(B2="",C2="",F2="",G2="",H2="",I2=""),"Debit/Credit Not Matching",IF(BG2=0,"Matched","Debit/Credit Not Matching"))) |
BG2:BG37 | BG2 | =IF(B2="","",ROUND(G2+I2+K2+M2+O2+Q2+S2+U2+W2+Y2+AA2+AC2+AE2+AG2+AI2+AK2+AM2+AO2+AQ2+AS2+AU2+AW2+AY2+BA2+BC2+BE2,2)) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
G2:BE19 | Expression | =AND($O2<>0,ISEVEN(COLUMN(B2))) | text | NO |