Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Copy Worksheet From Multiple Files

Can anyone share macrocode that will copy the second sheet of all the .xls files (about 140 files each month) in the “C:My DocumentsDatamonth01” directory to a workbook named “Month01.xls” and name each sheet using the value located in cell C2 of each of the sheets being copied. Hope someone can help me along...thanks, in advance...Turk

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Multiple Worksheet Copy And Paste Formatting Question (using VBA)

I hope someone on this forum can help me with this, I have posted three times on other forums and my post didn't even get read so after a glowing recommendation I've tried xtremevbtalk.

I am using the following script in Excel 2003:

Sub Combine()
Dim J As Integer

On Error Resume Next
Worksheets.Add ' add a sheet in first place
Sheets(1).Name = "Combined"

' copy headings
Selection.Copy Destination:=Sheets(1).Range("A1")

' work through sheets
For J = 2 To Sheets.Count ' from sheet 2 to last sheet
Sheets(J).Activate ' make the sheet active
Selection.CurrentRegion.Select ' select all cells in this sheets

' select all lines except title
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 82, Selection.Columns.Count - 8).Select

' copy cells selected in the new sheet on last line
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp).Offset(1, 0)(2)

End Sub
It has been changed slightly from where I found it on the web - sorry I can reference the site, I just closed the tab!!!!

Any way I've managed to change it to meet my requirements except for two things. Currently this script will collect the first 20 records from the first column from every worksheet and bring them into one worksheet. When it does this it copies each set of records underneath each other (on the last row).

How can I paste the records horizontally instead (on the last column instead)?

Also is there an easy was to auto resize the columns to fit the content (which differs in size)?

Thanks in advance for any help anyone can give me...I'm a total novice with VB and don't have a clue really.

How is it done?
I´ve seperated the Sources and Dests with a vbNullChar, however only the first destination is used so all my files end up in the same directory.



Copy Multiple Files
Hi all, thanks for taking the time to read my message,

I'm just new at this and trying to work all this out for myself, so far so good, but now I'm stuck.

I'm wanting to use VB to copy multiple files from one directory to another. I've been trying to use the FileCopy command, but it doesnt want to handle (as I see it) the multiple files.

I've used:
FileCopy RTrim(strSelectedSource) & "*.*", RTrim(strDestinations(i))

as one would expect to use the syntax from DOS days.

I also added a.. & "*.*" to the destination, also with no success.

I'm sure this has to be easy, but I guess everything is when you know how.


IS There A Way To Copy Multiple Files Together
Lets say I have these files:

and I want to copy them all to:


what can I do short of reading them line by line and apending them?

thanks scott

Copy Files To Multiple Location
how to copy file to multiple location by which can be done by 1 click.

let say the source is folder 1.( i jz want to copy the contents of folder 1) to
Folder A
Folder B
Folder C (file oredi exist ~ same as contents same as folder 1)

for folder C when copy to it, the contents of folder 1 will replace folder C without any notification dialog.

Edited by - wtkm on 4/22/2007 7:41:57 PM

Copy Multiple Files From Listbox To Specified Folder
like the title sais i want to select multiple files from the listbox and copy them to the specified folder but i get the error fle not found with this code. any help would be appeciated

If devicepath.Text = "" Then
Exit Sub
Dim ndx As Integer
ndx = List1.ListIndex
If ndx = -1 Then
MsgBox "nothing selected"
FileCopy mp3path.Text & List1.List(ndx), devicepath.Text
End If
End If
End Sub

Copy Same Range From Multiple Excel Files
How would I go about writing a macro that would allow me to to go through 10-12 XL files in a directory and copy the same range,A2-M200 for example, from all of them and to a new workbook or sheet.

Copy Multiple Files And Folders With Cancel

how can I create a program who copy a Folder (with all its content). The progress of the copy should be show with a progress bar and it should be possibile to cancel the copy at any time. Any idea ?

Best Regards

Alfredo DS

Copy From Worksheet To Worksheet??
I need to copy info from one cell in worksheet1 to another cell in worksheet2. The problem is I have a formulated cell in worksheet1 and when I copy from worksheet1 to worksheet2, it copies the formula. I need to copy the value only. Here's the code I'm using.

Worksheets("BT WORKSHEET").Range("A60").Copy

Thanks for any help.

To Copy Worksheet At The End Of Other Worksheet

Private Sub File1_Click()
FileCopy FileToCopy, NewFile
Exit Sub
End Sub

Private Sub Form_Load()
Me.Caption = "Copying..."

End Sub

How 2 Copy Worksheet To Another Using Vb6?
Hello Everybody,
Can you tell me how can i copy data from one worksheet to another worksheet using visual basic 6?
I get Error when i'm trying to use the paste method.

please help!

Thank you all in advance,

Help With Opening Multiple Txts Files In A Single Excel Files With Multiple Worksheets
I am new to using visual basic code as I usually use it for making macros inside the Excel program.

I would like to to open numerous text/ascii files into a excel file. I would like to write VB code that I can point to a directory (and it's subdirectories) to identify text files in the folder and import the data of each file into one excel file. Each separate file would be opened into a new work sheet. File1 goes to excel file worksheet 1, file2 same excel file worksheet 2 etc. etc. What is the best way to do this? Is there a script out there that already does this?
What I want to avoid is manually open up and copy each of these fields to a new or manually use the import text wizard as we will a large number of separate files with data.

This forum thread has the code which seems to do what I need but I got it to work only once and then i get errors all time.
Does it need to run as VB project or as a macro in excel??

microsoft has a example of what i want to do but again not in enough detail for a novice programmer is another example but i want to opem multiple files in one goal

After this code we have rearrange our using another excel marco and graph the data so we have a lot of work ahead of us
Thanks for your help in advance!


COPY Excel Worksheet With VBA
Hello again,

Now I am trying to copy a VBA created Excel Worksheet and append multiple copies at the end of the Workbook.

I have come up with this:

' copy Worksgeet (Index # 4) and paste 15 copies
Set xlWS = xlWB.Worksheets(4).Copy(, 15)

but I get this error:


Run-time error '1004':
Unable to get the Copy property of the Worksheet class

Any ideas to correcting this?

Copy To Current Worksheet
How do I copy the information i want to the current worksheet instead of having a new worksheet created.

Here's what i have so far.

Sub transferRecordset()

'Create a Recordset from all the records in the Orders table
Dim cost As String
Dim conn As New ADODB.Connection
Dim rs As ADODB.Recordset

cost = "Y:IQ38316DataAccessCost Stewardship.mdb"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & cost & ";"
conn.CursorLocation = adUseClient
Set rs = conn.Execute("CapexCurrentYear", , adCmdTable)

'Create a new workbook in Excel
Dim xlApp As Object
Dim xlBook As Object
Dim xlSheet As Object

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)

'Transfer the data to Excel
xlSheet.Range("A1").CopyFromRecordset rs

'Save the Workbook and Quit Excel
xlBook.SaveAs "c:My DocumentsADOExample.xls"

End Sub

Excel Copy From One Worksheet To Another ?
I'm trying to write a write a macro that will transfer each row of data in one worksheet to a second worksheet (for example data from each column 1 in a row on first worksheet will transfer to cell B5 on second worksheet, column 2 will transfer to E10, and so on), print the second worksheet, and then repeat for each row of data in worksheet 1. My question is, how can I write code that will make each row number on worksheet 1 a variable and each column number a constant, and each destination cell on worksheet 2 a constant. Other than that, I think I can just write code that will loop through each row.

I apologize for the length of my question, I'm kind of a rookie. Thanks for any suggestions.

Copy A Worksheet To Another Workbook

I've got a short question. How can i copy one single worksheet to another workbook.

Copy Excel Worksheet
How about if you wanna copy everything except the code in the worksheet? ie graphs, buttons, values (not formulas) but not the vb that lies with in the sheet?

Copy Recordset Into Worksheet.
I am using VBA in excel and I have written the following code:

Private Sub simpleConnection()

Dim IP_Address As String
Dim IP_UserId As String
Dim IP_Password As String
Dim cn_400 As ADODB.connection
Dim rs_400 As ADODB.Recordset
Dim i As Integer
Dim fldCount As Integer
Dim iCol As Integer
Dim sqlString As String

'Logon details for AS400
IP_Address = ""
IP_UserId = ""
IP_Password = ""

'Initialise the ADODB objects
Set cn_400 = New ADODB.connection
Set rs_400 = New ADODB.Recordset

'Set AS400 connection
cn_400.Mode = adModeReadWrite
cn_400.CursorLocation = adUseClient
cn_400.Open "Provider=IBMDA400;" & _
"Data source=" & IP_Address & ";" & _
"User Id=" & IP_UserId & ";" & _
"Password=" & IP_Password

'Create the SQL string
sqlString = "SELECT * from LS3DTA100.PROFORDP WHERE (((PSRCE = 'T') OR (PSRCE = 'F') " & _
"OR (PSRCE = 'P')) AND (PENTDT BETWEEN " & startDate & " AND " & endDate & "))"

'Open AS400 file
With rs_400
.Open sqlString, cn_400, adOpenStatic, adLockOptimistic, adCmdText
End With

'MsgBox (rs_400.RecordCount & " records imported")

'Create the new Excel workbook & worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add
Set xlWs = xlWb.Worksheets("Sheet1")

' Display Excel and give user control of Excel's lifetime
'xlApp.Visible = False
xlApp.Visible = True
xlApp.UserControl = True

' Copy field names to the first row of the worksheet
fldCount = rs_400.Fields.Count
For iCol = 1 To fldCount
xlWs.Cells(1, iCol).Value = rs_400.Fields(iCol - 1).Name

' Copy the recordset to the worksheet, starting in cell A2
xlWs.Cells(2, 1).CopyFromRecordset rs_400

' Auto-fit the column widths and row heights

' Close ADO objects
Set rs_400 = Nothing

End Sub

What I want to do is open this recordset (rs_400) in the current workbook on a specific worksheet (sheet 53 to be exact),rather than opening a new instance of excel and inserting the recordset into a new book and worksheet there (as I am doing above).

Seems to me that this should be fairly simple thing to do but I have no idea of the syntax.

Can anyone help?

Copy/rename Worksheet
How do I copy a sheet "Input Form" and rename it to "Input Form n", where 'n' is a sequential number? All the copied sheets must be in the same workbook (hence the sequential numbering).

My code is:
'Code to determine new name
Dim sh As Worksheet
n = 0
For Each sh In ActiveWorkbook.Sheets
shname = ActiveSheet.Name
If Left(shname, 10) = "Input Form" Then n = n + 1
Next sh

Sheets("Input Form").Copy Before:=Sheets("Input Form")
ActiveSheet.Name = newName 'the "newName" variable is defined elsewhere

I am having two problems:

1. My value for 'n' is always counting the total number of worksheets in the workbook (which is currently 6), instead of the number of worksheets whose name starts with "Input Form" (which is 1).

2. The code finishes after the .Copy line. Any code I place after this line is never run.

Any thoughts? Thanks!

Name New Worksheet By Copy And Paste
I am trying to write code that creates a number of new worksheets and I want the name for each new work sheet to be copy and paste from list of names in one other worksheet. Is this possible?

Creating A New Copy Of WorkSheet
I want to create a new copy of Excel Sheet which i am able to do through the command ThisWorkbook.ActiveSheet.Copy but the problem is that when the new sheet is created,it iniitiates the Activate Event and in the Activate Event there is a function which it is not able to find and it gives a Compile error as Sub or Function not defined.

Can anyone help me on this matter.

Please let me know if any additional information is required.



Copy Worksheet From One File To The Other
How do I copy worksheet from one file to another file?

Please Help....I Cannot Copy 1 Worksheet To Newworkbook?
I am trying to copy just one worksheet ("Access_Database") from one workbook into a new workbook with just the one sheet, not all of the sheets in the original. The code I have attached below works fine, except it copies all worksheets and not JUST the one I want to keep size of files down. Anyone have any suggestions as to what wrong with my code? I have tried various combinations of Worksheet, Sheets, Activesheet but, then, I get no copy being generated (probably a syntax issue)?

Code:Private Sub Auto_Close()
Dim wbDOCname As String

Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error Resume Next
MsgBox "Please Wait While project is saving and exiting"
docmd.hourglass = True
Worksheets("Access_database").Visible = True
ActiveSheet.Select = ("Access_Database")
wbDOCname = Sheets("Access_Database").Range("A2").Value
ActiveSheet.SaveAs Filename:="\ranchdataEEIAutoRollup" & wbDOCname & ".xls"


Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub


Edited by - bballava on 7/7/2005 9:18:08 AM

Copy Excel Worksheet

How do I make a copy of an excel worksheet in VB?


Larry Bargers

Copy Worksheet Excel

I have created a time clock program to track employee hours. The program saves the employees time in and time out to a .dat file. I then have VB call excel to create a report and add the employees hours for a time period. Currently I have one pre-formatted worksheet in Excel, and the program writes just the selected employees hours. I want to make it so VB copies the main formatted worksheet for all selected employees, so I'll be able to list each employee to a seperate worksheet. Any help will help.

Thank you,

Larry B.

<b><i>Larry Bargers</b></i>

Worksheet Cell Copy Woes
New to the forum and vba programming.
I am trying to automate the copying of certain cells from one worksheet to another in the same workbook.
I get an error '1004' regarding one piece of code referring to the worksheet range. Error follows:

Run-time error '1004'
Application-defined or object defined error

The code involved follows:

Do While Worksheets("Sheet1").Cells(crow, 1).Value <> ""
If Worksheets("Sheet1").Cells(crow, 5) = "x" Then
MsgBox "All code works except copy portion"

Worksheets("Sheet1").Range(Cells(crow, 1), Cells(crow, 3)).Copy _
Destination:=Worksheets("Sheet2").Range(Cells(crow, 1))

crow = crow + 1
MsgBox crow

I can eliminate the Worksheets("Sheet1").Range portion of code and all works well.
Is it possible to use the cells range language like this or must I do it another way?
Thank you in advance for your help.
Hope I've submitted correctly.
Thank you,

VB Copy One Cell To Another Worksheet By Click
I am making a part list sheet and i need the code, when u click on a row with partnr., amount, price, that it gets copied into another worksheet on a specific place.
Lets say I have 200 parts with diffrent parts numbers, i select 20 not following parts by clicking on each once, I want these 20 parts to show up in the 2nd worksheet.

Please help me.

Newbie ! Copy And Rename Worksheet
I'm a real beginer with VBA so am just trying to learn from other's codes and hope for the best

Can someone help me fix the below. It's to copy a sheet called BLANK and then rename the new sheet the contents of cell L1 of sheet INDEX. I can get the below to copy, but not rename :

Sub CreateGateway1()
' CreateGateway1 Macro
' Macro recorded 01/09/2005 by Nyanko
' Application.DisplayAlerts = False
Sheets("BLANK").Copy After:=Sheets(2)
Sheet.Name = Worksheets("Index").Range("L1").Value
checkerr = MsgBox("Record Created")
End Sub

Copy Rows From One Worksheet To Another Using Inputbox

I seem to have struck a brick wall with a code. Any help will be greatly appreciated.

Sheets("Orders") has a table A6:F20
Sheets("Products") has a list of products

I want to search Sheets("Products") Column A for any value entered through an inputbox and if a match is found then copy the whole row to the next available empty row in the table on Sheets("Orders").

The search item can contain alphabets, numbers, and or symbols and if the item is not found in the Sheet("Products") column A then a message should appear saying entry found. Also, if the table is full, then there should be a message saying cannot copy.

Here is what I have so far (even which doesn't work):

Sub Macro1()
Dim Ib As String
Dim rFound As Range
Ib = Application.InputBox("Enter Catalogue number")
rFound = Sheets("Products").Cells.Columns("A").Find(what:=Ib, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Address
Range(rFound).EntireRow.Copy Destination:=Sheets("Products").Range("A65536").End(xlUp).Offset(1, 0)
End Sub

Thanks in Advance


Copy Create Paste A Worksheet
Hi all,

How do I creat a new worksheet with a certain name and then copy paste one worksheet into it?

I am printing out Project and Project Phase milestones into excel.

There is a Worksheet called "Project Milestones"

There are an unkown number of phases in the project and I have to print a worksheet for each phase on a worksheet called strPhaseName & "Milestones" .

I need to add a worksheet and have it named strPhaseName & "Milestones"
Then I need to copy paste the "Project Milestones" worksheet into the new worksheet to get the graphics and formating.

Code below shows how I populate it:

Set xlsheet = xlbook.Worksheets("Project Milestones")

If Me.chkIncludeMilestones.Value = 0 Then
xlApp.DisplayAlerts = False
xlsheet.cells(1, 3) = Me.cboProject.Text & " Milestones"
SQL = "SELECT tblProjectMilestones.Auto_Index, tblProjectMilestones.strMilestoneName, tblProjectMilestones.dtmEstimatedDate, tblProjectMilestones.dtmActualDate, tblProjectMilestones.strComments " & _
"FROM tblProjectMilestones " & _
"WHERE tblProjectMilestones.intPR_Index = " & PR_Index & " " & _
"ORDER BY tblProjectMilestones.dtmEstimatedDate, tblProjectMilestones.dtmActualDate, tblProjectMilestones.strMilestoneName;"
Set rs = tdmsDB.Execute(SQL)
myRowNum = 3
While Not rs.EOF
For X = 1 To 4
If Not IsNull(rs(1)) Then xlsheet.cells(myRowNum, 1) = rs(1)
If Not IsNull(rs(2)) Then xlsheet.cells(myRowNum, 2) = Format(rs(2), StandardYearFormat)
If Not IsNull(rs(3)) Then xlsheet.cells(myRowNum, 3) = Format(rs(3), StandardYearFormat)
If Not IsNull(rs(4)) Then xlsheet.cells(myRowNum, 4) = rs(4)
Next X
myRowNum = myRowNum + 1
Set rs = Nothing

Copy A Worksheet And Lose The Macros

I have a very simple spreadsheet which the user completes with various numerical information. They then 'submit' the sheet by clicking a macro button.

The macro copies the sheet into a new workbook and saves it as a predefined filename into a folder on the user's c: drive.

The problem is that I need the saved file (which, incidentally is to be archived) to be devoid of any macros.

Is it possible to delete all macros automatically before the file is saved?

Macro To Copy Data To Another Worksheet
Hi I was wondering if someone could tell me if there is a way to highlight a row and copy certain bits of the information in the row to another worksheet i.e. data in A1,4,5,6 and 10 or on another selection H1,4,5,6 and 10 when you click a button.


Duplicating Worksheet Without Copy/Paste
I would also like to be able to ignore original Worksheet buttons/controls during duplication. This is needed for Worksheet archiving within the Workbook. Is it possible?

Copy Worksheet To VB Excel Component
Hi all,

I have a VB form containing a 'Microsoft Office XP Web Component' Spreadsheet called 'ss'.

I have an import button which when pressed opens up a browse dialog which the user can select an .xls file. This file is then opened invisibly.

VB Code:
CommonDialog1.ShowOpen            'then get the resulting filename            sFile = CommonDialog1.Filename                Dim xlTmp As Excel.Application    Set xlTmp = New Excel.Application     xlTmp.Workbooks.Open sFile    xlTmp.Visible = False    ' Code for actions to go here......        Set xlTmp = Nothing

I now need the worksheet on the .xls file to be copied and pasted into the Spreadsheet component on the VB form.

Is this possible as i have been trying a number of things and cant seem to get it working.

thanks for any help with this,


Copy Worksheet-Advanced Problem
Hi everyone,
I really need the smart people on this problem because I am well out of suggestions here. The problem is this: I have a workbook that is hidden, I want to copy any worksheet in the workbook and place it before "Sheet1" an example of the code i use is below.....

EFA.Workbooks(MyWorkBookName).Sheets("Anyworksheet").Copy Before:=Sheets("Sheet1")

EFA = Public EFA As New Excel.Application

MyWorkBookName (variable) holds the location and full filename of the workbook

The workbook is set to hidden before this code is read. Really need some help on this on how to fix it.

Thank you.

Excel VBA Button To Copy From One Worksheet To Another

Can anyone help me with this?

I'm trying to copy data from one Excel 97 worksheet to another within the same Excel Spreadsheet.
I would like to be able to click on a button within Excel to do this.



Copy Cells From One Worksheet To Another If A Specified Value Is Present
Hi everyone.

I'm new to VBA so I apologise if there is a very simple answer to this query. I have an Excel worksheet that contains a large amount of data and have been tasked to break the data down into certain workpackages. I have inserted a column where the workpackage number can be entered, but I now need to find a way to move the workpackages to different worksheets, i.e. All data numbered 1 to Sheet 2, data numbered 2 to Sheet 3 etc.

I hope this makes sense and I'd be grateful for any ideas anyone may have.



Edited by - MOD-David on 4/27/2004 2:28:01 AM

Copy Method Of Worksheet Class Failed
I have coded VBA in excel. This VBA is used to copy worksheets from the same excel file. I have this run-time error no 1004 "copy method of worksheet class failed" that pops up after I have run it a few times.

Below is the source code I used in VBA. Can someone help me to solve it?

Dim objOldSheet As Object
Dim objNewSheet As Object

Application.CutCopyMode = False
Worksheets(pstrSourceSheet).Copy After:=Worksheets(Worksheets.Count)
Set objNewSheet = Worksheets(Worksheets.Count)
If Not objNewSheet Is Nothing Then
objNewSheet.Name = pstrDestSheet
End If
Set objOldSheet = Nothing
Set objNewSheet = Nothing
Application.CutCopyMode = False

Copy Selected Column In Listbox To A New Worksheet
hi all
i am stuck can any 1 help plz urgent ... i using mulit select listbox to select the items in book3 but how do i take the column of the items that i selected, to be copy to a new worksheet(Price Check) in book4.example i selected Des(column G),Gross Weight(column I),Volume weight(column J), in the list.i dunno how to copy the columns of the items that i haven chosen and copy to a new worksheet(Price Check) like the example i have in book4 sheet2.

VB6/Excel - Go Back To Original Worksheet After Copy.
Hello everyone,
I copied/create a new worksheet from my existing worksheet(sheet1). How can I go back to the original sheet after the copy function?

This is my code:

sheets(1).Copy After:=sheets(1)
How can I go back to sheets(1) and manipulate it, because there are some values in sheets(1) that I need to delete.


Worksheet.Copy Placed Online Behaves Buggy
Good Day,

This Excel 97/VBA is executed online from a web server. Two things are wrong with the Save Routine:

1. I do a Worksheet.Copy, Save it, Close it, and Retun to ThisWorkbook.

The problem is after this executes there is a big empty Window named "Microsoft Excel [Read-only]" which has the focus. My guess is that a new window is opened to create a new Workbook, then copies the Worksheet in. After Saving & Closing, only the empty window is left. If I close this empty window, my Application stops. My Application is running in a separate Window.

2. In the debugger, I see that "Application.ScreenUpdating = False" never gets set to False. Odd!

Here is the Save Routine:

Private Sub cmdSave_Click()
Dim varFileName As Variant

On Error GoTo 300
ChDir "C:"
varFileName = Application.GetSaveAsFilename("My Report", "Excel File(*.xls),*.xls", , "Save My Report")
Loop Until varFileName <> False
If (VarType(varFileName) = vbString) Then
Application.ScreenUpdating = False
ActiveWorkbook.SaveAs FileName:=varFileName, FileFormat:=xlWorkbookNormal
ActiveWorkbook.Close savechanges:=False
Application.ScreenUpdating = True
End If
Exit Sub
MsgBox Err.Number & " " & Err.Description
Resume Next
End Sub
The question is, How do I remove the big empty Window and stop it from receiving focus? I would like that window to go away after the Workbook is closed. Why does "ScreenUpdating = False" fail? I need the WkSheet to refresh itself after line deletion (in another section of code).

I have tried so many variations of code including making a New Excel Application, but it didn't work. The code works fine offline, but place it online and the rules change. If this has happened to anyone, please share your solution.

Thank you, LadyA

Copy Picture From UserForm To Image1 In To A Worksheet
I am confronting a problem in placing or copying a picture already loaded in an Image1 from a UserForm in to an Image1 placed in a WorkSheet called (“Print Sheet”) Or just place it into range (“L7”) in the WorkSheet

I already managed to transfer all data from de UserForm in to the (“Data Sheet”) except the picture.

I wrote the following code:

' Transfer the values into the sheets
Sheets("Print Sheet").Range("D6").Value = Modify_Family.TextBox1.Value ' Ok

' But this doesn’t seam to work.

Sheets("Print Sheet"). Image1.Picture = Modify_Family.Image1.Picture
Sheets("Print Sheet"). Range (“L7”). Value = Modify_Family.Image1.Picture

Does anyone know a better way of doing this?

Copy Image Object From Workssheet To Worksheet
Hello All,
Few days ago I posted a question about accessing image objects that werre in a different worksheet from the active.
Unfortunately nobody didn't know the way so I started to think in other ways...

What I want to do in summary is to copy an image from a worksheet to another. Being able to decide more or lest the position where it will be copied.

Copy image1 from sheet 1 to A1 or somewhere in sheet 2.

Is so simple, I know, but I don't find the way...
Of course I have tried to copy the range, but the image object is not copied.

Anybody could help me?

Thanks a lot!

Copy Method Of Worksheet Class Failed.
I am running into a problem trying to copy multiple sheets into the same Excel Document, the following code works fine for anything under 3 sheets, howeve r anything over 3 it errors on the line I marked below. I have discovered that if I use a blank Excel Workbook and try to preform multiple copies it works as it suppose to without any errors, but it doesn't work with my "Template" workbook I need to use.

Is there some reason that this process would work for a blank worksheet but not one that has a table / graphics already on it. Is there some limitation of what excel can copy within a worksheet.

I can attach the worksheet if needed

VB Code:
'Start a new workbook in Excel    On Error GoTo EntireFirm_Err        Set oExcel = CreateObject("Excel.Application")      'New Excel Application        Set oBook = oExcel.Workbooks.Open(Template)         'Open Excel          For clc = 1 To Firms.Count            'now need to make new sheet for next statement            Set oSheet = oBook.Worksheets(oBook.Sheets(oBook.Sheets.Count).Name)            lngSheetCount = oBook.Sheets.Count            'Copy inital last sheet into new sheet            oExcel.ActiveWorkbook.Sheets(lngSheetCount).Copy _ After:=oExcel.ActiveWorkbook.Sheets(lngSheetCount) 'ERROR <<<<            'Do things within sheet         Next On Error GoTo 0Exit Sub EntireFirm_Err:MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure EntireFirm of Module Statements"End Sub

Compare, Copy Non Contiguous Cells To New Worksheet

I'm a VBA newbie who desperately needs help with a macro that should copy non-contiguous cells when matching values belonging to two columns from two different worksheets, to a third worksheet.

The problem is that I get a runtime error = 1004 on the copy execution (after the Else.) I believe it's a referencing problem.

The macro is:

Sub Macro1()
For x = 1 To Sheets("Campaign").Range("B2").End(xlDown).Row
For y = 1 To Sheets("Loaninfo").Range("I9").End(xlDown).Row
If Sheets("Campaign").Cells(x, 2) <> Sheets("Loaninfo").Cells(y, 9) Then
found = False


Sheets("Loaninfo").Range(Cells(y, 1), Cells(y, 9)).Copy _
End If

Next y
Next x
End Sub

Thanks in advance.


(URGENT)Copy Excel Worksheet In Access
Hon'ble gurus,
I use VB6 and OfficeXp. Is it possible to transfer one excel worksheet in Access? Of course, the fields that I've in Exce is already made in Access. If possible, how is it to be done? Please advise. Thanks.


VB6/Excel - Go Back To Original Worksheet After Copy.
Hello everyone,
I copied/create a new worksheet from my existing worksheet(sheet1). How can I go back to the original sheet after the copy function?

This is my code:

sheets(1).Copy After:=sheets(1)

How can I go back to sheets(1) and manipulate it, because there are some values in sheets(1) that I need to delete.


URGENT!! Worksheet Copy Method Excel/VB

How do I use the Excel Worksheet Copy Method? Code please.

Thank you,

Larry Bargers

Protect Multiple Worksheet?
Need to be able to protect and unprotect multiple worksheets via the excel protection menu.
Need to be able to trap the password the user enters and password protect all other opened worksheets automatically.

Does anybody know how to do this.

Copyright © 2005-08, All rights reserved