Saving VBA Code And A Counter

Morrissey

Board Regular
Joined
Mar 8, 2002
Messages
85
Hello I have A Problem And I Need A Solution Quickly, I Have A Button Which When Clicked I Want To Do The Follwoing Things

->Copy A Selection Of My Cells from 'A1' to 'G49' (I Have Also Named These cells a range called 'export1' Onto A New Workbook

->Have This New Workbook Automatically Saved While And Then Have To Workbook Closed

When This Has Been Done 250 Times I Would Like A Message Box To Come Up Saying A Customised Message

I Need All The VB Code For This Please Help Me!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi yes I've Seen That It's Where I Got My Idea However I Want The Range I Have Copied Over To A New Work Sheet (So That No Macros Are On The New Workbook) I See You Know About VBA So Could You Help Me With This Please?
 
Upvote 0
I'll try to help. Let me get this straight.

You have a workbook that is going to contain the VBA. You have a range of values that are going to be copied a pasted into a new workbook. Now, is there going to be a new workbook created each time the copy and paste action is carried out? Or are we copying and pasting to the same workbook each time? You then want this new workbook closed and saved.

After the copy and paste has occured 250 times, you want a message box to be thrown up. Is this an accurate description of what you want?

The reason I ask is that I've answered some questions by people on this board and when I provide the solution they ask for, the criteria suddenly changes. (stupid A Level students are particularly bad for this)
 
Upvote 0
Ok I will make The Workbook It's Going To Be Pasted On A Template Lets' Say Its Called Invoice Template 2 I Want My Range ('Export1') Pasted To The Template (So That all The Macros I Have On The Other Template Are Not There) And When This Is Done 250 Times I Want A Message To Come Up I Hope That Helps
 
Upvote 0
On 2002-03-21 12:58, Morrissey wrote:
Ok I will make The Workbook It's Going To Be Pasted On A Template Lets' Say Its Called Invoice Template 2 I Want My Range ('Export1') Pasted To The Template (So That all The Macros I Have On The Other Template Are Not There) And When This Is Done 250 Times I Want A Message To Come Up I Hope That Helps

OK, a little better. I understand your reasons for this now.

The workbook will be called ""Invoice Template 2.xls"

Is there any particular sheet or range you want these values to be copied to in the template? Or is he sheet in the new work book going to be called

Actually this doesn't matter I'm just going to be using my own range and my won workbooks for now.


You say "When This Is Done 250" you want a message box to get thrown up. Are you talking about pasting the data 250 times here?
 
Upvote 0
OK, last question, I think. Is the template workbook going to be open or closed before the button is pressed?
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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