Need Help in VBA Code

  • Hi Excel Friends


    I Need Help From You


    I have applied this Below VBA to Copy Matched Data from Entire Row with to Given Sheet Name By InPutBox's here what happening this vba is copying matched data from entire workbook to given sheet name by inputbox successfully


    Here what i want this VBA will Copy Matched Data From ActiveSheet only to Given Sheet Name By InPutBox Not from Entireworkbook Match


    and one more if i given a sheet name by inputbox and the sheet is not exist in workbook then it will ask me by msgbox sheet not found do you want to create a sheet by given name then click yes


    here i getting run time error when i type sheet name by inputbox and the sheet is not exist in workbook




  • Go to Best Answer
  • Could you attach a copy of your file? It would be easier to see how your data is organized and to test possible solutions. Include a detailed explanation

    of what you want to do using a few examples from your data and referring to specific cells, rows, columns and sheets. De-sensitize the data if necessary.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Try:

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Hi Mumps


    Thank you for written new code it's working fine


    here i need some changes from your vba code


    1. after copying data to outputws sheet then all columns should be autofit


    2. after copying data to outputws sheet then it will show me MsgBox "Results pasted to " & "(" & OutputWs.Name & ")" & " Sheet"

    and select that sheet OutputWs.Select


    3. and it's copying data from heading i don't want to copy heading just copy data only i mean avoid heading in data


    and if i copying data again from another sheet to same outputws sheet then already have data in that outputws sheet is getting overwritten

    • Best Answer

    Try:

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • PrasadK

    Selected a post as the best answer.
  • You are very welcome. :)

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Hi Mumps


    i need a last help from you


    can you please change range (A) into inputbox

    here when i run this vba it will ask column range name by inputbox

  • Will this be the column to search for the value?

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • if i want to copy matched value data from another column like C or D


    if i enter a value from another column in (inputbox of what are you looking for?) and then i have to get another inputbox to ask which column range name & then i Type C in inputbox then copy all matched data


    that why i asked


    can you please change the range address to inputbox

  • Try:

    Please be patient when waiting for a reply.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • No problem. Sometimes it takes time to change and test a macro. Also, sometimes Forum members are not online to see your request. Did the macro work as you requested?

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • You are very welcome. :)

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!