hkbhansali
Board Regular
- Joined
- Oct 26, 2013
- Messages
- 51
Hi,
I have record a macro and its work fine but I have one difficulty.
Can anyone please help me with some code to copy a column "E" and paste special Value it in the first empty column ("F") in a same worksheet.
Here is my Macro
I have record a macro and its work fine but I have one difficulty.
Can anyone please help me with some code to copy a column "E" and paste special Value it in the first empty column ("F") in a same worksheet.
Here is my Macro
Code:
[/I][/I]Sub Macro1()'
' Macro1 Macro
'
'
Dim vFile As Variant
'Showing Excel Open Dialog Form
vFile = Application.GetOpenFilename("Excel Files (*.xlsx)," & _
"*.xl*", 1, "Select Excel File", "Open", False)
'If Cancel then exit
If TypeName(vFile) = "Boolean" Then
Exit Sub
End If
'Open selected file
Workbooks.Open vFile
Range("A1:M1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Nifty50Bhav.Activate
Sheets("Bhav Copy").Select
Range("A1").Select
ActiveSheet.Paste
Range("N1").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
Sheets("ind_nifty50list").Select
Range("E2").Select
ActiveCell.FormulaR1C1 = "='Bhav Copy'!R[1]C[6]"
Range("E3").Select
Selection.FormulaArray = _
"=INDEX('Bhav Copy'!R1C6:R3000C6,MATCH(RC[-2]&RC[-1],'Bhav Copy'!R1C2:R3000C2&'Bhav Copy'!R1C13:R3000C13,0))"
Range("E3").Select
Selection.Copy
Range("E4:E100").Select
ActiveSheet.Paste
Range("F2").Select
Application.CutCopyMode = False
Range("A1").Select
End Sub
[I][I]