meetdudhia
New Member
- Joined
- Jul 8, 2011
- Messages
- 14
Sub function_macro()
Range("A2").Select
ActiveCell.FormulaR1C1 = "=IF(ISTEXT(RC[1]),RC[1],IF(ISTEXT(R[-1]C),R[-1]C,))"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A4886")
Range("A2:A4886").Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Tickt_No"
Range("A2").Select
Columns("A:A").EntireColumn.AutoFit
ActiveCell.FormulaR1C1 = ""
Range("B2:B4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-18
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub
Range("A2").Select
ActiveCell.FormulaR1C1 = "=IF(ISTEXT(RC[1]),RC[1],IF(ISTEXT(R[-1]C),R[-1]C,))"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A4886")
Range("A2:A4886").Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Tickt_No"
Range("A2").Select
Columns("A:A").EntireColumn.AutoFit
ActiveCell.FormulaR1C1 = ""
Range("B2:B4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-18
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub