Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select a sheet to copy from one workbook to another

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Select a sheet to copy from one workbook to another

How about instead of worksheets(2) using activeworksheet

--
Don Guillett
SalesAid Software

"holysoul " wrote in message
...
Hi everyone,

my problem is that I have to import ( copy) a sheet from another excel
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, i
want the person who'll be using this program to be able to select the
sheet she wants to copy (because the compagny who supplys us the second
file in which we go get the sheet, never places it at the same place
AND there are 2 sheets almost identical... one of them being the one I
want ).

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

here is what i've got for now but it presumes that the sheet is always
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).Copy
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!


---
Message posted from
http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select a sheet to copy from one workbook to another

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

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I CAN'T SELECT THE CELLS IN A WORKBOOK I WANT TO COPY MRS LEE Excel Discussion (Misc queries) 0 November 22nd 06 01:26 AM
select a range, copy it to a new sheet Dave F Excel Discussion (Misc queries) 1 September 22nd 06 08:06 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Excel Discussion (Misc queries) 1 June 10th 05 12:17 AM
Copy select sheets to another Workbook Randy[_11_] Excel Programming 0 January 14th 04 05:06 PM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"