excel 用宏将日期数字类型的列转换为字符文本列 c#导入excel 日期变成数字 怎么办?这是最好的解决办法
2012-08-22 11:13
1056 查看
Sub 宏1()
Dim m As String
For i = 2 To 40000
If Cells(i, 3) <> "" Then
m = Cells(i, 3)
Cells(i, 3).Select
Selection.NumberFormatLocal = "@"
Cells(i, 3) = m
End If
Next
End Sub
Sub 宏1()
Dim AA As String
Dim BB As String
For I = 2 To 5000
If Cells(I, 1) <> "" Then
AA = Cells(I, 1)
BB = Cells(I, 7)
Cells(I, 1).Select
Selection.NumberFormatLocal = "@"
Cells(I, 7).Select
Selection.NumberFormatLocal = "@"
Cells(I, 1) = AA
Cells(I, 7) = BB
End If
Next
End Sub
Sub QUTONG()
For I = 2 To 2000
If Cells(I, 2) <> O Then
If Cells(I - 1, 2) = Cells(I, 2) Then
Rows(I + 1 & ":" & I + 1).Select
Selection.Delete Shift:=xlUp
End If
End If
Next
End Sub
对所有的单元格格式化:
Sub format_string()
Dim m As String
For i = 1 To 60000
For j = 1 To 28
If Cells(i, j) <> "" Then
m = Cells(i, j)
Cells(i, j).Select
Selection.NumberFormatLocal = "@"
Cells(i, j) = m
End If
Next
Next
End Sub
Dim m As String
For i = 2 To 40000
If Cells(i, 3) <> "" Then
m = Cells(i, 3)
Cells(i, 3).Select
Selection.NumberFormatLocal = "@"
Cells(i, 3) = m
End If
Next
End Sub
Sub 宏1()
Dim AA As String
Dim BB As String
For I = 2 To 5000
If Cells(I, 1) <> "" Then
AA = Cells(I, 1)
BB = Cells(I, 7)
Cells(I, 1).Select
Selection.NumberFormatLocal = "@"
Cells(I, 7).Select
Selection.NumberFormatLocal = "@"
Cells(I, 1) = AA
Cells(I, 7) = BB
End If
Next
End Sub
Sub QUTONG()
For I = 2 To 2000
If Cells(I, 2) <> O Then
If Cells(I - 1, 2) = Cells(I, 2) Then
Rows(I + 1 & ":" & I + 1).Select
Selection.Delete Shift:=xlUp
End If
End If
Next
End Sub
对所有的单元格格式化:
Sub format_string()
Dim m As String
For i = 1 To 60000
For j = 1 To 28
If Cells(i, j) <> "" Then
m = Cells(i, j)
Cells(i, j).Select
Selection.NumberFormatLocal = "@"
Cells(i, j) = m
End If
Next
Next
End Sub
相关文章推荐
- excel导入sql数据,数字类型字段变科学计数的简单解决办法
- Excel数字、文本混合列导入SQL Server出现的问题&解决办法
- 关于Excel中手机号码导入MSSQL中变成Double类型解决办法
- 让EXCEL中日期转换成文本后不再变成数字
- 解决了从Excel导入数据库时,数字类型在导入到DataSet时变成科学记数法
- Excel数字、文本混合列导入SQL Server出现的问题&解决办法
- [已解决]android:Excel(数字00001)导入sql server中变成float类型成了1
- Excel数字、文本混合列导入SQL Server出现的问题&解决办法
- Excel 手机号码、身份证 等信息 导入到SQL2005 中,转换成字符是自动变成 科学计数法 的解决方法
- POI读取excel日期显示为数字的解决办法
- phpexcel 导入操作 excel日期类型转换
- C# 导入Excel遇到数字字母混合列数据丢失解决
- 关于excel 导出数字类型变成科学记数法的问题解决 导出EXCEL后格式的问题 科学记数法 显示
- c#无法将类型int隐式转换为string怎么解决?
- Python3.6导入excel中的电话号码会自动转成float类型的解决办法
- 解决excel日期变成数字的问题
- java导出:防止EXCEL或WPS的将文本自动转换为日期或数字格式
- Excel导入SQL SERVER,数字和字符会被系统自动置为NULL的解决方法
- Excel文件导入到SQL,文本、数字丢失,变成NULL的处理
- 从EXCEL导入文件时无法将DBNull.Value强制转换为类型。。。,请使用可空类型 问题的解决