babyheomoi
Thành viên thường trực




- Tham gia
- 22/9/13
- Bài viết
- 395
- Được thích
- 91
Mình chỉ mới bập bẹ học VBA!
Mình xài marco, và dùng công thức cho file của mình!
Tuy nhiên, theo mình biết thì đã dùng vba thì hạn chế dùng hàm!
Mình đưa code vba file mình theo marco, nhờ các cao thủ rút ngắn và hướng dẫn để mai mốt mình thực hiện!
Code 2
mình cám ơn trước, mong các bác cho em ít kinh nghiệm khi xử lý code!
Mình xài marco, và dùng công thức cho file của mình!
Tuy nhiên, theo mình biết thì đã dùng vba thì hạn chế dùng hàm!
Mình đưa code vba file mình theo marco, nhờ các cao thủ rút ngắn và hướng dẫn để mai mốt mình thực hiện!
Mã:
Sub updatedata()
'
' updatedata Macro
'
'
ActiveCell.Select
Range("BQ3:BQ250").Select
Selection.Formula = "=VLOOKUP(RC[-67],[updateTD.xlsm]data!R2C8:R10000C87,25,FALSE)"
Range("BR3:BR250").Select
Selection.Formula = "=VLOOKUP(RC[-68],[updateTD.xlsm]data!R2C8:R10000C87,29,FALSE)"
Range("BO3:BO250").Select
Selection.Formula = "=VLOOKUP(RC[-65],[updateTD.xlsm]data!R2C8:R10000C87,13,FALSE)"
Range("BP3:BP250").Select
Selection.Formula = "=VLOOKUP(RC[-66],[updateTD.xlsm]data!R2C8:R10000C87,14,FALSE)"
Range("BZ3:BZ250").Select
Selection.Formula = "=VLOOKUP(RC[-76],[updateTD.xlsm]data!R2C8:R10000C87,11,FALSE)"
Selection.NumberFormat = "0.00%"
ActiveWorkbook.Save
Code 2
Mã:
Sub Texttocolum()
'
' Texttocolum Macro
' Text to colum
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Columns("T:T").Select
Selection.TextToColumns Destination:=Range("T1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("U:U").Select
Selection.TextToColumns Destination:=Range("U1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("V:V").Select
Selection.TextToColumns Destination:=Range("V1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("W:W").Select
Selection.TextToColumns Destination:=Range("W1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("X:X").Select