VBA Macros to Copy Specific Cells Values from Multiple Sheets to Specific Cells in Summary Sheets

chittunoo

New Member
Joined
Nov 18, 2023
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi Mr. Expert,
Please. Can anyone help me with this VBA Macros to run for Daily Data Copying?

I have attached -
1. Daily recorded file (Filename include Month & Year) with Sheets (Named as each day of that month) (Data are recorded in Formatted Table) : from where only values from Specific Multiple Cells will be copied
2. Daily/Monthly Summary File with each Sheets summarized for Each fiscal Year: e.g. 2023 - 2024. -> Multiple Copied values to be pasted at corresponding Multiple Cells at respective Date Column from respective Year Sheet.

I had recorded Macros in Manual Copying to show how it will be copied. Due to my limited VBA skills, I was unable code them exactly as I wanted.
Can any Experts be willing to help me with?


Daily Records (Nov 2023).xlsx
ABCDEFGH
119.11.2023(အလှကုန်)
2
3လက်ငင်းBank A/CအကြွေးDiscountငွေသုံး
4S3231119001 - လက်လီမုန့်14,300
5S3231119002 - မမိုးမိုးစမ်း (ဓနုဖြူ)249,100
6S323111900376,500
7S3231119004
8S3231119005
9S3231119006
10S3231119007
11S3231119008
12S323111900914,300
13S3231119010
14S3231119011အကြွေးရှင်း / ငွေရှင်း
15S3231119012
16S3231119013
17S3231119014
18S32311190150
19
20အကြွေးဝယ်
21
22
23
240
25
26325,600000ငွေလွှဲထုတ်ပေး / စိုက်ရှင်း
27
28အကြွေးရငွေသားBank A/CDiscountမှတ်ချက်
29
30
31
320
33
34Total Cash 311,300
35အပ်ငွေ
36000ပိုငွေ / လိုငွေ -311,300
19.11.2023
Cell Formulas
RangeFormula
H12H12=SUM(H4:H11)
H18,H24H18=SUM(H15:H17)
B26:E26B26=SUM(B4:B25)
H32H32=SUM(H27:H31)
H34H34=B26+B36-H12-H18-H32-SUMIF(B4:B25,">0",E4:E25)-SUMIF(B29:B35,">0",D29:D35)
B36:D36B36=SUM(B29:B35)
H36H36=H35-H34
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H36Cell Value>=0textNO
H36Cell Value<0textNO



2.
Yearly Records.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
111November 2023
112အရောင်းWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuSat
1131-Nov2-Nov3-Nov4-Nov5-Nov6-Nov7-Nov8-Nov9-Nov10-Nov11-Nov12-Nov13-Nov14-Nov15-Nov16-Nov17-Nov18-Nov19-Nov20-Nov21-Nov22-Nov23-Nov24-Nov25-Nov26-Nov27-Nov28-Nov29-Nov30-NovTotal
114Cash (လက်ငင်း)2,221,8001,659,6501,868,950376,8001,903,9002,014,850747,200265,700167,1001,044,9501,721,0502,267,30051,700311,300356,5501,520,35018,499,150
115Bank (ငွေလွှဲ)1,632,000179,700444,400872,00063,0003,191,100
116Credits (ကြွေးပေး)8,964,1504,222,0004,704,2001,973,0502,139,6001,194,750656,6002,330,5003,180,0004,700,8002,817,350294,70037,177,700
117Discount (လျှော့ငွေ)20,3501,40020012,7504,30020026,05065,250
118Debits (ကြွေးရ - ငွေသား)6,491,800819,15010,0003,498,000451,2002,226,00013,496,150
119Debits (ကြွေးရ - Bank A/C)309,6004,632,9003,523,3001,056,000494,3004,909,700996,4003,125,8003,147,600329,30022,524,900
120Discount (ကြွေးလျော့ငွေ)0
121Expenses (သုံး - ငွေသား)1,00091,60017,5007003,60061,500154,80090,80076,80043,6003,20016,60072,0002,20025,10026,600687,600
122ဆိုင်ပစ္စည်းယူ (ငွေရှင်း)0
123ဆိုင်ပစ္စည်းယူ (ကြွေး)0
124Cash Out (ငွေလွှဲထုတ် / စိုက်ရှင်း)205,500275,85064,500545,850
125Total Cash Sales (ရငွေ - ငွေသား)2,220,8008,059,8501,851,450376,1002,719,45001,953,150565,800187,9003,588,300725,50001,713,5502,701,8002,141,200309,100331,4501,493,75000000000000030,939,150
126Cash IN (အပ်ငွေ - ငွေသား)2,222,0008,070,0001,852,000385,0002,720,0001,953,000566,000188,0003,589,000725,0001,714,0002,702,0002,142,000310,000332,0001,494,00030,964,000
127ပိုငွေ / လိုငွေ1,20010,1505508,9005500(150)200100700(500)0450200800900550250000000000000024,850
2023 - 2024
Cell Formulas
RangeFormula
B112:AF112B112=B113
G125,U125:AF125,M125G125=G114+G118-G117-G121-G122-G124
AG114:AG127AG114=SUM(B114:AF114)
B127:AF127B127=B126-B125
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B127:AF127Cell Value>=0textNO
B127:AF127Cell Value<0textNO
B112:AF112Cell Valuebeginning with "S"textNO


VBA Code:
Sub Macro5()
'
' Macro5 Macro
'

'
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Sheets("19.11.2023").Select
    Range("B26").Select
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Sheets("2023 - 2024").Select
    Range("T114").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("C26").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T115").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("D26").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T116").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("E26").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T117").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("B36").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T118").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("C36").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T119").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("D36").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T120").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("H12").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T121").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("H18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T122").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("H24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T123").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("H32").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T124").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Windows("Daily Records (Nov 2023).xlsx").Activate
    Range("H34:H35").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("Yearly Records.xlsx").Activate
    Range("T125").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I saw that you need to copy value of total to summary sheet and each row and column in summary sheet is permanent but how about daily recorder file? is toltal row of each value of it permanent too?
 
Upvote 0
Hi eiloken,

Thanks for your reply.

- "Daily Record file" has "Sheets" named as each working date of a month. i.e. "19.11.2023", "20.11.2023", "22.11.2023", etc (without those off days).
- Each Sheets from "Daily Record file" is formatted the same. i.e. Data to copy from them is at specific cells and it is same cell locations for all Sheets.
- "Summary file" or "Yearly Record file" has "Sheets" named as fiscal year. i.e. "2023 - 2024", "2022 - 2023", etc
- Each Sheets from "Summary file" has Monthly Tables with columns as each day of that months. i.e. October 2023 table with 1-Oct, 2-Oct, below that table is November 2023 table with 1-Nov, 2-Nov, etc.
- Data copied from "Daily Record file" are to be pasted value at respective column (i.e. corresponding date)
e.g. Copied data from "19.11.2023" Sheet to be pasted value at respective cells at "November 2023" table at "19-Nov" column
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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