snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub AddNew()
Dim wbName As String
wbName = [A1].Value
Set NewBook = Workbooks.Add
With NewBook
.Title = wbName
' add your additional code here
.SaveAs Filename:=wbName
End With
End Sub
You do not have the required permissions to view the files attached to this post.
Sub AddNew()
Dim wbName As String
wbName = [A1].Value
Set NewBook = Workbooks.Add
With NewBook
.Title = wbName
' add your additional code here
.SaveAs Filename:=wbName
End With
Call CopyPaste
End Sub
Sub CopyPaste()
'
' Macro3 Macro
'
'
Range("A2:G6").Select
Selection.Copy
Windows("UserID.xlsx").Activate
Range("A2").Select
ActiveSheet.Paste
End Sub
You do not have the required permissions to view the files attached to this post.
Sub AddNew()
Dim wbName As String
Dim rAll As Range
Dim rTarget As Range
Set rAll = Sheets("tblUsers").Range("A2:G6")
wbName = [A1].Value
Set NewBook = Workbooks.Add
With NewBook
Set rTarget = Sheets("Sheet1").Range("A1")
.Title = wbName
' add your additional code here
rAll.Copy rTarget
.SaveAs Filename:=wbName
End With
' Call CopyPaste
End Sub
Sub AddNewbomxxTEST()
Dim wbName As String
Dim rAll As Range
Dim rTarget As Range
Set rAll = Sheets("Report0").Range("A2:k43")
wbName = [I1].Value
Set NewBook = Workbooks.Add
With NewBook
Set rTarget = Sheets("Sheet1").Range("A1")
.Title = wbName
' add your additional code here
rAll.Copy rTarget
.SaveAs Filename:=wbName
End With
' Call CopyPaste
End Sub
Sub CopyPaste()
'
' Macro3 Macro
'
'
Range("A2:k43").Select
Selection.Copy
Windows("UserID.xlsx").Activate
Range("A2").Select
ActiveSheet.Paste
End Sub
You do not have the required permissions to view the files attached to this post.
Sub AddNew()
Dim wbName As String
Dim rAll As Range
Dim rTarget As Range
Set rAll = Sheets("Report0").Range("A1:k43")
wbName = [I1].Value
Set NewBook = Workbooks.Add
With NewBook
Set rTarget = Sheets("Sheet1").Range("A1")
.Title = wbName
' add your additional code here
rAll.Copy rTarget
.SaveAs Filename:=wbName
End With
' Call CopyPasteokmai
End Sub
Sub CopyPasteokmai()
Range("A1:k43").Select
Selection.Copy
Windows("UserID.xlsx").Activate
Range("A2").Select
ActiveSheet.Paste
Windows("UserID.xlsx").Activate
Range("A1:J42").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("L25").Select
End Sub
You do not have the required permissions to view the files attached to this post.
Sub CreateNew()
Sheets("Report0").Select
Sheets("Report0").Copy
Application.DisplayAlerts = False
With ActiveWorkbook
wbName = [I1].Value
.Title = wbName
.SaveAs Filename:=wbName
End With
Application.DisplayAlerts = True
End Sub
Sub CreateNew()
Sheets("Report0").Select
Sheets("Report0").Copy
Application.DisplayAlerts = False
With ActiveWorkbook
wbName = [I1].Value
.Title = wbName
.SaveAs Filename:=wbName
End With
Application.DisplayAlerts = True
End Sub
Sub AddNew()
Dim wbName As String
Dim rAll As Range
Dim rTarget As Range
Set rAll = Sheets("Report0").Range("A1:k43")
wbName = [I1].Value
Set NewBook = Workbooks.Add
With NewBook
Set rTarget = Sheets("Sheet1").Range("A1")
.Title = wbName
' add your additional code here
rAll.Copy rTarget
.SaveAs Filename:="D:\KEEPER_BOM\" & wbName
End With
' Call CopyPasteokmai
End Sub
You do not have the required permissions to view the files attached to this post.