• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

copy to another workbook based on cell value

i have a workbook (wb1)with several sheets. copy the active sheet to another workbook that is stored in folder z:\catalogue in xlsm forms but the filename will be the same as a cell value (ah33) in active sheet after the copied sheet will be renamed as sheet +1. if there is a sheet name sheet1 so the copied sheet will be renamed as sheet2
 
my apologies about my thread yesterday
i am writing again what i want to do.
wb1 sheet1 copy and paste to workbook store in z:\catalogue in xlsm form
but the filename of it is in wb1 sheet1 cell ah2,
but the copied sheet will be paste and renamed if there is previous a sheet called sheet1 then the sheet will be renamed as sheet2 etg.
upto now i have these 3 codes,
trying to combine them

[Sub open_category()


Dim wkbkSource As Workbook

Dim strPath As String

strPath = "Z:\catalogue\"

Set wkbkSource = Workbooks.Open(strPath & Range("ah2").Value & ".xlsm")

End Sub]

[Sub ChangeWorkSheetName()
'Updateby20140624
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
newName = Application.InputBox("Name", xTitleId, "", Type:=2)
For i = 1 To Application.Sheets.Count
Application.Sheets(i).Name = newName & i
Next
End Sub]

[Sub Macro1()
'
' Macro1 Macro
'

'
Sheets("sheet1").Select
Sheets("sheet1").Copy Before:=Workbooks("BAZAAR.xlsm").Sheets(1)
End Sub]
 
Back
Top