excel_VB宏脚本_批量生成点餐宝接受的格式
Attribute VB_Name = "模块1" '作者:landv
'开发时间:2015年12月28日18:09:34
'主要功能,为东风路小厨生成农行点餐宝所支持批量导入的格式。复制H行到TXT文本修改成UTF_8格式即可。 Function pinyin(p As String) As String i = Asc(p) Select Case i Case - To -: pinyin = "A" Case - To -: pinyin = "B" Case - To -: pinyin = "C" Case - To -: pinyin = "D" Case - To -: pinyin = "E" Case - To -: pinyin = "F" Case - To -: pinyin = "G" Case - To -: pinyin = "H" Case - To -: pinyin = "J" Case - To -: pinyin = "K" Case - To -: pinyin = "L" Case - To -: pinyin = "M" Case - To -: pinyin = "N" Case - To -: pinyin = "O" Case - To -: pinyin = "P" Case - To -: pinyin = "Q" Case - To -: pinyin = "R" Case - To -: pinyin = "S" Case - To -: pinyin = "T" Case - To -: pinyin = "W" Case - To -: pinyin = "X" Case - To -: pinyin = "Y" Case - To -: pinyin = "Z" Case Else: pinyin = p End Select End Function Function getpy(str) For i = To Len(str) getpy = getpy & pinyin(Mid(str, i, )) Next i End Function Sub landv() '删除无用
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("G:K").Select
Selection.Delete Shift:=xlToLeft
'剪切类别到第一行
Columns("E:F").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
'删除格式
Cells.Select
Selection.ClearFormats
'删除B2
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft '批量替换成类别编码,没有用循环,直接暴力一点吧。
Columns("A:B").Select
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="白酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="本地", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="茶水", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果盘", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果汁", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="红酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="花雕酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅锅底", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅肉类", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅蔬菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅小料", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="凉菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="面点", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="啤酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="破损", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="商品", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="四大罩", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="香烟", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="烤鱼", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="伴侣", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="热菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="烧烤", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="铁板", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="蒸炖", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="雅间费", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="饮料", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False '品相名称转换成拼音
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("D1").Select
ActiveCell.FormulaR1C1 = "=getpy(RC[-1])"
Range("D1").Select
Selection.AutoFill Destination:=Range("D1:D395")
Range("D1:D395").Select
'插入管道符
Range("G1").Select
ActiveCell.FormulaR1C1 = "|"
Range("G1").Select
Selection.AutoFill Destination:=Range("G1:G395")
Range("G1:G395").Select
'生成最终格式
Range("H1").Select
ActiveCell.FormulaR1C1 = _
"=RC[-7]&RC[-1]&RC[-6]&RC[-1]&RC[-5]&RC[-1]&RC[-4]&RC[-1]&RC[-3]&RC[-1]&RC[-2]"
Range("H1").Select
Selection.AutoFill Destination:=Range("H1:H395")
Range("H1:H395").Select End Sub
处理几个小毛病,对其他人适用性不是很大,作为参考还是可以的嘛
Attribute VB_Name = "自动处理"
'版本:1.0.2
'作者:landv
'开发时间:2015年12月28日18:09:34
'主要功能,为东风路小厨生成农行点餐宝所支持批量导入的格式。复制H行到TXT文本修改成UTF_8格式即可。 Function pinyin(p As String) As String i = Asc(p) Select Case i Case - To -: pinyin = "A" Case - To -: pinyin = "B" Case - To -: pinyin = "C" Case - To -: pinyin = "D" Case - To -: pinyin = "E" Case - To -: pinyin = "F" Case - To -: pinyin = "G" Case - To -: pinyin = "H" Case - To -: pinyin = "J" Case - To -: pinyin = "K" Case - To -: pinyin = "L" Case - To -: pinyin = "M" Case - To -: pinyin = "N" Case - To -: pinyin = "O" Case - To -: pinyin = "P" Case - To -: pinyin = "Q" Case - To -: pinyin = "R" Case - To -: pinyin = "S" Case - To -: pinyin = "T" Case - To -: pinyin = "W" Case - To -: pinyin = "X" Case - To -: pinyin = "Y" Case - To -: pinyin = "Z" Case Else: pinyin = p End Select End Function Function getpy(str) For i = To Len(str) getpy = getpy & pinyin(Mid(str, i, )) Next i End Function Sub landv()
'变量,文件最后一行
Dim a_hang
a_hang = ActiveSheet.Cells(Rows.Count, ).End(xlUp).Row - '删除无用
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("G:K").Select
Selection.Delete Shift:=xlToLeft
'剪切类别到第一行
Columns("E:F").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
'删除格式
Cells.Select
Selection.ClearFormats
'删除B2
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft '批量替换成类别编码,没有用循环,直接暴力一点吧。
Columns("A:B").Select
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="白酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="本地", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="茶水", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果盘", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果汁", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="红酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="花雕酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅锅底", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅肉类", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅蔬菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅小料", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="凉菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="面点", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="啤酒", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="破损", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="商品", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="四大罩", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="香烟", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="烤鱼", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="伴侣", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="热菜", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="烧烤", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="铁板", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="蒸炖", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="雅间费", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="饮料", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False '品相名称转换成拼音
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("D1").Select
ActiveCell.FormulaR1C1 = "=getpy(RC[-1])"
Range("D1").Select
Selection.AutoFill Destination:=Range("D1:D" & a_hang)
Range("D1:D" & a_hang).Select
'插入管道符
Range("G1").Select
ActiveCell.FormulaR1C1 = "|"
Range("G1").Select
Selection.AutoFill Destination:=Range("G1:G" & a_hang)
Range("G1:G" & a_hang).Select
'生成最终格式
Range("H1").Select
ActiveCell.FormulaR1C1 = _
"=RC[-7]&RC[-1]&RC[-6]&RC[-1]&RC[-5]&RC[-1]&RC[-4]&RC[-1]&RC[-3]&RC[-1]&RC[-2]"
Range("H1").Select
Selection.AutoFill Destination:=Range("H1:H" & a_hang)
Range("H1:H" & a_hang).Select MsgBox "搞定了,该怎么感谢我呢!" End Sub
2015年12月31日15:20:30
版本:1.0.3
定义了转换类别的变量,这样可以方便阅读,也方便了修改。
仍然采用暴力解决,准备在1.0.4版本定义函数并使用循环,从而进行压缩代码。
Attribute VB_Name = "自动处理"
'版本:1.0.3
'作者:landv
'开发时间:2015年12月28日18:09:34
'主要功能,为东风路小厨生成农行点餐宝所支持批量导入的格式。复制H行到TXT文本修改成UTF_8格式即可。 Function pinyin(p As String) As String i = Asc(p) Select Case i Case - To -: pinyin = "A" Case - To -: pinyin = "B" Case - To -: pinyin = "C" Case - To -: pinyin = "D" Case - To -: pinyin = "E" Case - To -: pinyin = "F" Case - To -: pinyin = "G" Case - To -: pinyin = "H" Case - To -: pinyin = "J" Case - To -: pinyin = "K" Case - To -: pinyin = "L" Case - To -: pinyin = "M" Case - To -: pinyin = "N" Case - To -: pinyin = "O" Case - To -: pinyin = "P" Case - To -: pinyin = "Q" Case - To -: pinyin = "R" Case - To -: pinyin = "S" Case - To -: pinyin = "T" Case - To -: pinyin = "W" Case - To -: pinyin = "X" Case - To -: pinyin = "Y" Case - To -: pinyin = "Z" Case Else: pinyin = p End Select End Function Function getpy(str) For i = To Len(str) getpy = getpy & pinyin(Mid(str, i, )) Next i End Function Sub landv()
'变量,文件最后一行
Dim a_hang
a_hang = ActiveSheet.Cells(Rows.Count, ).End(xlUp).Row -
'定义转换类别变量
dim 小厨热菜,小厨凉菜,小厨蒸炖,小厨烤鱼,小厨烤鱼伴侣,小厨烧烤,小厨面点,四大罩,会馆热菜,会馆凉菜,会馆海鲜,会馆高档类,果盘,饮料,吧台,火锅锅底,火锅肉类,火锅蔬菜,火锅小料,包桌套餐,面点
小厨热菜 =
小厨凉菜 =
小厨蒸炖 =
小厨烤鱼 =
小厨烤鱼伴侣 =
小厨烧烤 =
小厨面点 =
四大罩 =
会馆热菜 =
会馆凉菜 =
会馆海鲜 =
会馆高档类 =
果盘 =
饮料 =
吧台 =
火锅锅底=
火锅肉类=
火锅蔬菜=
火锅小料=
包桌套餐=
面点=
'删除无用
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("G:K").Select
Selection.Delete Shift:=xlToLeft
'剪切类别到第一行
Columns("E:F").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
'删除格式
Cells.Select
Selection.ClearFormats
'删除B2
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft '批量替换成类别编码,没有用循环,直接暴力一点吧。
Columns("A:B").Select
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨烤鱼", Replacement:=(""&小厨烤鱼), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨烤鱼伴侣", Replacement:=(""&小厨烤鱼伴侣), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨凉菜", Replacement:=(""&小厨凉菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨面点", Replacement:=(""&小厨面点), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨热菜", Replacement:=(""&小厨热菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨烧烤", Replacement:=(""&小厨烧烤), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="小厨蒸炖", Replacement:=(""&小厨蒸炖), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="雅间费", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="洋酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="饮料", Replacement:=(""&饮料), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="月饼", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="白酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="包桌套餐", Replacement:=(""&包桌套餐), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="本地", Replacement:=(""&会馆热菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="茶水", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="川菜", Replacement:=(""&会馆热菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="高档类", Replacement:=(""&会馆高档类), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果盘", Replacement:=(""&果盘), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="果汁", Replacement:=(""&饮料), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="海鲜", Replacement:=(""&会馆海鲜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="红酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="红酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="花雕酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅锅底", Replacement:=(""&火锅锅底), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅肉类", Replacement:=(""&火锅肉类), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅蔬菜", Replacement:=(""&火锅蔬菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="火锅小料", Replacement:=(""&火锅小料), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="凉菜", Replacement:=(""&会馆凉菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="面点", Replacement:=(""&会馆面点), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="啤酒", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="破损", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="商品", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="四大罩", Replacement:=(""&四大罩), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="外包菜", Replacement:=(""&会馆热菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="香烟", Replacement:=(""&吧台), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Columns("A:B").EntireColumn.Select
Selection.Replace What:="湘菜", Replacement:=(""&会馆热菜), LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False '品相名称转换成拼音
Columns("D:D").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("D1").Select
ActiveCell.FormulaR1C1 = "=getpy(RC[-1])"
Range("D1").Select
Selection.AutoFill Destination:=Range("D1:D" & a_hang)
Range("D1:D" & a_hang).Select
'插入管道符
Range("G1").Select
ActiveCell.FormulaR1C1 = "|"
Range("G1").Select
Selection.AutoFill Destination:=Range("G1:G" & a_hang)
Range("G1:G" & a_hang).Select
'生成最终格式
Range("H1").Select
ActiveCell.FormulaR1C1 = _
"=RC[-7]&RC[-1]&RC[-6]&RC[-1]&RC[-5]&RC[-1]&RC[-4]&RC[-1]&RC[-3]&RC[-1]&RC[-2]"
Range("H1").Select
Selection.AutoFill Destination:=Range("H1:H" & a_hang)
Range("H1:H" & a_hang).Select MsgBox "搞定了,该怎么感谢我呢!" End Sub
excel_VB宏脚本_批量生成点餐宝接受的格式的更多相关文章
- 使用vbs脚本进行批量编码转换
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看分析在Linux系统下开发的项目代码,我们知道Linux系统中文本文件默认编码格式是UTF-8,而Windows中文系统中的默 ...
- 【转】Bash脚本实现批量作业并行化
首先附上自己常用的代码 ---------------------------------------------------------------------------------------- ...
- C# 脚本代码自动登录淘宝获取用户信息
C# 脚本代码自动登录淘宝获取用户信息 最近遇到的一个需求是如何让程序自动登录淘宝, 获取用户名称等信息. 其实这个利用SS (SpiderStudio的简称) 实现起来非常简单. 十数行代码就可 ...
- (转)通过shell脚本实现批量添加用户和设置随机密码以及生产环境如何批量添加
通过shell脚本实现批量添加用户和设置随机密码以及生产环境如何批量添加 原文:http://www.21yunwei.com/archives/4773 有一个朋友问我如何批量创建用户和设置密码 , ...
- shell脚本:批量修改文件名
参考链接1:shell脚本:批量修改文件名(删除文件名中字符) 参考链接2:linux shell 字符串操作详解 (长度,读取,替换,截取,连接,对比,删除,位置 ) 参考链接3:每天一个linux ...
- c语言中的# ## 可变参数宏 ...和_ _VA_ARGS_ _
1.#假如希望在字符串中包含宏参数,ANSI C允许这样作,在类函数宏的替换部分,#符号用作一个预处理运算符,它可以把语言符号转化程字符串.例如,如果x是一个宏参量,那么#x可以把参数名转化成相应的字 ...
- 上传菜品数据&生成点餐二维码
基础数据上传 在门店助手打开数据上传功能,点击上传到微餐厅3.0,,即将门店本地的基础数据上传到线上. 注意1:上传前,需要在线下系统维护好基础数据 注意2:线下基础数据发生更改时,需要手动在门店助手 ...
- 【shell脚本】批量修改扩展名===modifyExtension.sh
前提:需切换到需要批量修改扩展名的目录下,运行脚本 [root@VM_0_10_centos shellScript]# cat modifyExtension.sh #!/bin/bash # 编写 ...
- 将psd格式批量转换成jpg或png格式(C#自制软件)
此项目基于.net framework 4.0 将psd格式批量转换成jpg或png格式. 链接:https://pan.baidu.com/s/16IEjX0sHaY9H3Ah7mv6IPQ 提取码 ...
随机推荐
- springboot学习笔记-1 第一个springboot示例
springboot是一个微框架,其设计的目的是为了简化spring框架的搭建和配置过程.从而使开发人员不再需要定义样板化的配置.下面是springboot的入门案例:它演示了利用springboot ...
- 【angular】angular实现简单的tab切换
html: <div class="list-group" ng-repeat="tab in menuList"> <a href=&quo ...
- 研究表明,VR社交有助于内向者改变性格
目前,外界对于VR的普遍观点是这种头显提供了一种孤立的.反社会性的体验.但很少有人会意识到,虚拟现实同时也存在着能够增进人与人之间的关系的可能性. Facebook(脸书)IQ是人们连接这一社交网络的 ...
- HTML学习总结(四)【canvas绘图、WebGL、SVG】
一.Canvas canvas是HTML5中新增一个HTML5标签与操作canvas的javascript API,它可以实现在网页中完成动态的2D与3D图像技术.<canvas> 标记和 ...
- Attribute的理解和认识
1什么是Attribute? 在网上看到这样一段定义 MADN的定义为:公共语言运行时允许添加类似关键字的描述声明,叫做attributes, 它对程序中的元素进行标注,如类型.字段.方法和属性等.A ...
- [6278009]使用Visual Stuido Code 编写Markdown
使用Visual Stuido Code 编写Markdown void main() { printf("Hello world!"); } void main() { Cons ...
- Hibernate5-课程笔记4
单表查询: Hibernate是DAO层技术,对数据的使用,查询是最为重要的.Hibernate的查询技术非常强大,支持原始SQL语句查询,支持QBC查询及Hibernate特有的HQL查询. H ...
- 使用automake等命令自动生成Makefile文件
参考:http://www.cnblogs.com/njucslzh/archive/2010/04/29/1723320.html
- Jedis实现发布订阅功能
Redis为我们提供了publish/subscribe(发布/订阅)功能.我们可以对某个channel(频道)进行subscribe(订阅),当有人在这个channel上publish(发布)消息时 ...
- Mysql的转义字符
Mysql的转义字符是"\",即反斜杠,在INSERT语句中,如果被插入的文本中包含反斜杠,那么反斜杠会被吃掉.例如: INSERT INTO tb (id,json) VALUE ...