软件:Excel
版本:2013
各位前辈好
小弟目前整理资料已经用VBA超连结将分页汇入活页簿了
现在想再多做一个动作 新增一栏在资料最前面并填上资料名称
如下图所示
https://imgur.com/a/Z0f6ADv
Sub 测试()
'
' 测试 宏
'
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
ActiveCell.Value, TextToDisplay:=ActiveCell.Value
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets("物料主档").Select
Sheets("物料主档").Copy Before:=Workbooks("物料主档.xlsm").Sheets(1)
'
End Sub
Sub 机种()
'
' 机种 宏
'
'
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A6").Select
ActiveCell.FormulaR1C1 = "机种"
Range("A7").SelectD
ActiveCell.FormulaR1C1 = "=Source!R[-6]C"
Range("A7").Select
Selection.Cut
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveCell.Replace What:="Camerlation_Rule_", Replacement:="",
LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Find(What:="Camerlation_Rule_", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("A7:A240")
Range("A7:A240").Select
End Sub
请问要怎么做才能让他自动抓Source分页中的名称?
并且在做下一笔时可以自动抓下一笔?
目前想应该是上面标红色部分要做修改 但不知道怎么改...
请各位前辈指点 谢谢