Auto Update Macros

PROGEON

New Member
Joined
Sep 19, 2006
Messages
3
A spreadsheet updates information on a weekly basis.When we record the macro when can only select a particular column in excel to copy. Once the spreadsheet is updated the system automatically recognise that a new column is updated
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
Welcome to the board.

I think you'll have to provide some more specific details, and maybe an example and what you expected results are.
 

PROGEON

New Member
Joined
Sep 19, 2006
Messages
3
I am recording a macro to extract data from another spreadsheet which is updated on a weekly basis. When recording the macro the system recognises which column to copy and paste, but when the spreadsheet is updated the following week the initial macro would still copy the initially specified column and does not copy the new weeks data. Please can you advice me on the process if there is one to make the macro intelligent enough to capture updated figures. Your help is greatly appreciated.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
Yes, but we need some logic to determine which column to copy. Is it always the last (right-most column)? Which row can we look at and try to determine where the last column exists?

That is why I was asking for more specific details. We need to know the specific layout of the spreadsheet you are trying to copy from, and where the new data will be showing up.
 

PROGEON

New Member
Joined
Sep 19, 2006
Messages
3
Yes, it is always the last right column which is suppose to be copied. I am sorry but I dont understand what the second part of your question means. Its row number 4 that we can look at to determine the last column updated. Thanks
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
You can use this code to get the last populated column in Row 4. That should give you what you need for your code.
Code:
    Dim myLastColNum As Integer
    myLastColNum = Range("IV4").End(xlToLeft).Column
 

Forum statistics

Threads
1,136,272
Messages
5,674,749
Members
419,525
Latest member
helensesc

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
Top