excel编辑中怎么用"宏"完成批处理

来源:百度知道 编辑:UC知道 时间:2024/05/21 19:45:06
043212345678
56789012
67891234
78901234
假设12345678 56789012 67891234 78901234 都是电话号码,这样的数据有10000个,我想在每个号码前加个区号,比如加"0432"要是每个都加的话实在太麻烦,所以请教高人,怎么样用excel中的"宏"来完成这个批处理操作!!!
本人很着急,多谢!!!

Sub 加区号()
Cells.Select
'选择整个表去掉表格线
Range("F1").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Rows("2:2").Select
'选择第2行
Selection.Insert Shift:=xlDown
'在第2行前插入一行,保持第2行为选中状态
num = 021 区号
'区号+电话
为100×3即num = 300
col = 13
'栏数,如表有17栏则
'col=17
num1 = 4 一共有几行
Do While num1 <= num
'循环插入空行
Range(Cells(num1, 1), Cells(num1, col)).Select

Loop
Range(Cells(1, 1), Cells(1, col)).Select
Application.CutCopyMode = False
'剪切复制模