+ Reply to Thread
Results 1 to 8 of 8

Automated copy paste using macro

  1. #1
    Registered User
    Join Date
    10-24-2007
    Location
    Greeley, CO
    Posts
    53

    Automated copy paste using macro

    Hello all,
    What I am trying to do is automate a series of select copy and select paste satements based off a cell value. The cell value that I am refrencing is months(Jan, Feb, Mar,etc...) I would like to have a button that when pressed looks at the cell B2's value then looks at the case for the appropriate value and performs the corresponding select, paste routines. I am not sure if the procedure I am using to perform this routine is the best method. Any help that any one could provide would be greatly apprciated. Thanks in advance

    Bob

    I won't post all the code because it is repeated for each month I will just include Jan through Mar. That way I won't exceed the character limit.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    Change this part of the code:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Just a note, if you want to use LCase because they might type in the month in all uppercase or all lowercase, then you'll need to change all of the Cases as well.

    Example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-24-2007
    Location
    Greeley, CO
    Posts
    53
    Thanks for the help...although I am sorry to say that I am still getting an error. Not sure if I missed something but here is what it is saying.

    Complie error Type mismatch and it highlights target

    Please Login or Register  to view this content.
    Thanks again
    Bob

  4. #4
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    Try just getting rid of this line.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-24-2007
    Location
    Greeley, CO
    Posts
    53
    No Dice,
    Error message compile error variable not defined.
    Thanks again!

  6. #6
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    Please Login or Register  to view this content.
    Make sure you don't have this line as target.value.

  7. #7
    Registered User
    Join Date
    10-24-2007
    Location
    Greeley, CO
    Posts
    53
    yawnzzzz,
    I figured it out....the reason it was not working is because I needed to activate the sheet that had the case values that I was looking for.

    Please Login or Register  to view this content.
    Thanks again for your help

    bob

  8. #8
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    Good to hear. It's always the simple things that get you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. macro to copy and paste data
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2008, 10:28 AM
  2. Automation macro produce error when copy and paste
    By Klam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2007, 06:14 AM
  3. simple copy paste macro required
    By normanjones4 in forum Excel General
    Replies: 2
    Last Post: 02-27-2007, 12:00 PM
  4. Macro to Copy and Paste in designated column/row
    By rizmomin in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-19-2007, 01:09 AM
  5. Copy and paste macro onto single sheet
    By simonsmith in forum Excel General
    Replies: 6
    Last Post: 10-24-2006, 05:29 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1