|
楼主 |
发表于 2022-12-16 11:59
|
显示全部楼层
本帖最后由 zdh8083 于 2022-12-16 13:17 编辑
套了个代码,可是不知道为啥只能更新“数据一”那个工作簿。。。。
Sub 数据处理()
Application.ScreenUpdating = False
Dim FileName As String, Wb As Workbook, CSRQ, GZRQ, RSRQ, ZJHM
FileName = Dir(ThisWorkbook.Path & "\*.xls*")
If FileName <> ThisWorkbook.Name Then
Fn = ThisWorkbook.Path & "\" & FileName
Workbooks.Open (Fn)
Worksheets(1).Select
Range("A1").CurrentRegion.Value = Range("A1").CurrentRegion.Value
CSRQ = Range("1:1").Find("出生日期").Column
Columns(CSRQ).NumberFormatLocal = " YYYY-MM-DD"
GZRQ = Range("1:1").Find("参加工作日期").Column
Columns(GZRQ).NumberFormatLocal = " YYYY-MM-DD"
RSRQ = Range("1:1").Find("入司日期").Column
Columns(RSRQ).NumberFormatLocal = " YYYY-MM-DD"
ZJHM = Range("1:1").Find("证件号码").Column
Columns(ZJHM).NumberFormatLocal = " @"
Workbooks(Fn).Close True
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
|
|