+ Reply to Thread
Results 1 to 5 of 5

macro help

  1. #1
    Registered User
    Join Date
    02-28-2011
    Location
    oregon
    MS-Off Ver
    Excel 2003
    Posts
    2

    macro help

    what i am trying to accomplish is

    i have several worksheets in a workbook- i have combobox1 on my "main" worksheet-
    my combobox1 is populated with all my worksheet names- so my question is-
    How can i Copy a row from "main" and paste it to a worksheet that is selected in my combobox1- i need to find the first free row and all that good stuff when pasting-
    i tried recording a macro and i am totally lost.
    thanx in advanced

  2. #2
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: macro help

    With more information about what row(s) to copy and where to paste them and how to action the macro, you'll get a better answer.

    Here's one way - assumes the following:
    1. Required cells are selected before selecting an option in the combobox
    2. The macro is to run once the user selects an option in the combobox

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-28-2011
    Location
    oregon
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: macro help

    wow thanx for the quick reply i think iam on the right track- but when i debug i get an error at

    ActiveWorkbook.Sheets(ComboBox1.Value).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)


    Private Sub ComboBox1_Change()
    If ComboBox1.Value <> "" Then
    Rows("18:19").Select
    Selection.Copy
    ActiveWorkbook.Sheets(ComboBox1.Value).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
    Application.CutCopyMode = False
    End If
    End Sub
    Last edited by 1newguy1; 03-01-2011 at 01:03 AM.

  4. #4
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: macro help

    Quote Originally Posted by 1newguy1 View Post
    wow thanx for the quick reply i think iam on the right track- but when i debug i get an error at

    ActiveWorkbook.Sheets(ComboBox1.Value).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
    What's the error?
    Where i have ComboBox1 you'll need to substitute in the name you have give your ComboBox.
    You needn't select to rows first, go straight to copy.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: macro help

    Hi and welcome to the board, unfortunately

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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