Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Saving VBA Code And A Counter

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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!

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    come on someone must know this is very important

  3. #3
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Maybe you can adapt some of the suggestions here to suit your needs:

    http://www.mrexcel.com/board/viewtop...rum=2&start=10

    HTH

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?

  5. #5
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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)

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  7. #7
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No When The Button Is Pressed 250 Times THe Range I Want Is Called 'Expot1' Or A1 To G49

  9. #9
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    OK, last question, I think. Is the template workbook going to be open or closed before the button is pressed?

  10. #10
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    closed

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •