How to copy a column to another column in another workbook according to today's date using VBA?

MazExpress

Board Regular
Joined
Aug 5, 2020
Messages
56
Office Version
  1. 2010
Platform
  1. Windows
I'm totally new to VBA. I want to build a code that can DAILY copy values of column B in a workbook named by today's date (picture 1)
Picture1new.jpg
Picture1new.jpgPicture2new.jpg to sheet 1 in another workbook named Credit (picture 2) in the column corresponding to today's date. The column headers of the file Credit is the days of every month starting from column E.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the Forum MazExpress,

See if this will do what you want.

VBA Code:
Sub findDate()
'Declare toDay
Dim toDay As String
toDay = Format(Date, "dd-mm-yyyy")
ThisWorkbook.Sheets(toDay).Activate
Range(Range("G2"), Range("G2").End(xlDown)).Copy
Workbooks.Open "add path here/Credit.xlsx" 'Enter the path and change the file extension if needed
Sheets("Sheet1").Activate
Cells.Find(What:=Date, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
        ActiveCell.Offset(1).Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,597
Members
449,174
Latest member
chandan4057

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