Select a sheet to copy from one workbook to another

H

holysoul

Hi everyone,

my problem is that I have to import ( copy) a sheet from another exce
file into the one I'm in right now (the one with my VBA code etc...)
copy it is OK but what i want to do is when the other workbook opens,
want the person who'll be using this program to be able to select th
sheet she wants to copy (because the compagny who supplys us the secon
file in which we go get the sheet, never places it at the same plac
AND there are 2 sheets almost identical... one of them being the one
want ).

So in simple, when the second workbook opens, would it be possible fo
the user to go click on the worksheet she wants, or anything similar t
that ...?

here is what i've got for now but it presumes that the sheet is alway
in the second position.

Sub ImporterFeuilleQSS()

Dim fichierQSS
Dim wkbk1 As Workbook
Dim wkbk2 As Workbook
Dim Wks As Worksheet

Application.ScreenUpdating = False


fichierQSS = Application.GetOpenFilename("Feuilles Excels (*.xls)
*.xls")
If fichierQSS <> "Faux" Then
Application.Workbooks.Open (fichierQSS)
Else
Application.ScreenUpdating = True
Exit Sub
End If

Set wkbk1 = Workbooks(2)
Set wkbk2 = Workbooks("Conversion en Ascii.xls")


wkbk1.Worksheets(2).Cop
after:=wkbk2.Worksheets(wkbk2.Worksheets.Count)
Set Wks = ActiveSheet
Wks.Name = "Commande QTT"
Cells.EntireColumn.Hidden = False

Workbooks(2).Close (False)

Application.ScreenUpdating = True

End Sub


Thanks for anyone trying ...anything :p

Holysoul
 
H

holysoul

could be good, but how do i pause my code so that i can go select whic
sheet i want and then make it resume to take the activesheet (beein
the one I selected)

Find this, and you'll be my new God!

Holysou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top