vba中自动复制数据至自动新生成的工作表中
SetNewWorksheet=Worksheets.Add'新建一个以当日日期命名的工作表NewWorksheet.Name=Day(Now())&"日"Range("...
Set NewWorksheet = Worksheets.Add '新建一个以当日日期命名的工作表
NewWorksheet.Name = Day(Now()) & "日"
Range("A5:I69").Select
Selection.Copy
Sheets(Day(Now()) & "日").Select
ActiveSheet.Paste
Columns("I:I").ColumnWidth = 15.13
Columns("H:H").ColumnWidth = 14.13
Sheets("Sheet1").Select
Range("B10:I69").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
大师帮我看看代码问题 展开
NewWorksheet.Name = Day(Now()) & "日"
Range("A5:I69").Select
Selection.Copy
Sheets(Day(Now()) & "日").Select
ActiveSheet.Paste
Columns("I:I").ColumnWidth = 15.13
Columns("H:H").ColumnWidth = 14.13
Sheets("Sheet1").Select
Range("B10:I69").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
大师帮我看看代码问题 展开
展开全部
'定义原工作表和新工作表
Dim NewWorksheet, ThisSheet As Worksheet
'关闭屏幕更新
Application.ScreenUpdating = False
Set ThisSheet = ActiveSheet
Set NewWorksheet = Worksheets.Add '新建一个以当日日期命名的工作表
NewWorksheet.Name = Day(Now()) & "日"
'复制当前工作表数据
ThisSheet.Select
Range("A5:I69").Select 'ThisSheet.
Selection.Copy
'切换到新工作表,并粘贴数据、调整H、I列宽度
NewWorksheet.Select
NewWorksheet.Range("A5").Select
NewWorksheet.Paste
Columns("I:I").ColumnWidth = 15.13 'NewWorksheet.
Columns("H:H").ColumnWidth = 14.13 'NewWorksheet.
'切换回原工作表,并清除部分单元格内容
ThisSheet.Select
ThisSheet.Range("B10:I69").Select
Selection.ClearContents
Range("A1").Select 'ThisSheet.
'打开屏幕更新
Application.ScreenUpdating = True
Dim NewWorksheet, ThisSheet As Worksheet
'关闭屏幕更新
Application.ScreenUpdating = False
Set ThisSheet = ActiveSheet
Set NewWorksheet = Worksheets.Add '新建一个以当日日期命名的工作表
NewWorksheet.Name = Day(Now()) & "日"
'复制当前工作表数据
ThisSheet.Select
Range("A5:I69").Select 'ThisSheet.
Selection.Copy
'切换到新工作表,并粘贴数据、调整H、I列宽度
NewWorksheet.Select
NewWorksheet.Range("A5").Select
NewWorksheet.Paste
Columns("I:I").ColumnWidth = 15.13 'NewWorksheet.
Columns("H:H").ColumnWidth = 14.13 'NewWorksheet.
'切换回原工作表,并清除部分单元格内容
ThisSheet.Select
ThisSheet.Range("B10:I69").Select
Selection.ClearContents
Range("A1").Select 'ThisSheet.
'打开屏幕更新
Application.ScreenUpdating = True
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询