Copy from Worksheet

March 5, 2009 by vba excel
Filed under: Excel Vba 
Sponsor

Excel Vba Question:

Im having problem when i want to copy a worksheet using excel vba macro function, having the name of a worksheet in cell A1, I would like to extract
non-contiguous data from the sheet of that name and paste it onto my “Data
temp” sheet. How can I copy the data from worksheet using excel vba function to extract from the named sheet onto the Data Temp sheet?

Excel Vba Answer:

To copy the data from worksheet using excel vba function to extract from the named sheet onto the Data Temp sheet, use this macro:

Sub move_it()
Dim ws As Worksheet
Set ws = Sheets(Range(”A1″).Value)
s = Array(”B1″, “Z1″)
For i = LBound(s) To UBound(s)
ws.Range(s(i)).Copy Sheets(”Data temp”).Range(s(i))
Next
End Sub

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...


Incoming excel search terms

excel vba copy worksheet,vba copy worksheet,excel vba copy sheet,excel vba copy worksheet to another,vba copy sheet,excel vba duplicate worksheet,mss,copy columns from one workbook to another using vba,copy excel worksheet vba,copy worksheet vba,copy worksheets vba,excel copy worksheet vba,excel macro copy data specific worksheet,excel macro copy range,excel sheets copy from one sheet to another,excel vba clear worksheet,excel vba exact copy of sheet,excel vba sheets copy,excel worksheet copy vba,ms excel vba to copy sheet from named worksheet,vba code to paste data from one worksheet to another,vba copy a worksheet,vba copy array to worksheet,vba copy cells worksheet,vba copy excel file into another excel file,vba copy excel sheet,vba copy excel worksheet data,vba copy range from one worksheet to another,vba copy spreadsheet,vba copying cells into array,vba excel worksheet copy,* sheet excel vba,activate worksheet vba without having the exact name,active worksheet vba,array worksheets vb excel,cell worksheet cells copy vba,clear sheet vba,clear worksheet excel vba,clear worksheet vba,clearing cells in excel worksheet visual basic,copy a range in a specific worksheet vba,copy a worksheet in excel vba,copy a worksheet in vba,copy an exact copy of a sheet to another workbook in vba excel,copy and paste cells based on specific criteria in visual basic,copy array from one worksheet to another,copy array vba excel sheets,copy array worksheets to new workbook,copy cell and paste into another sheet using vba,copy cell formula using excel vba



Related Excel Tips

Comments

2 Comments on Copy from Worksheet

  1. Pete Ingenhutt on Wed, 5th Aug 2009 6:42 pm
  2. I want to have the name in an Excel worksheet cell to automatically become the name on the sheets tab. Is there a formula that will do this automatically?

  3. Kari on Mon, 21st Sep 2009 10:39 pm
  4. I just don’t get it:; I have the same question and it has been answered, but I need the answer simplified for someone that needs exact step by step to get it done. I have an excel workbook and I want the information which is just one word that I enter in a cell of the sheet to automatically become the name on the tab at the bottom. Is there an easy explination or example?

Have another excel answer or questions for this problem ?
Feel free to post it here..