excel_userss
New Member
- Joined
- Jun 4, 2019
- Messages
- 11
Hi All
I would like to create a macro where i can paste Columns of Option, Strike and Expiry in respective sheets(sheet name is on left). I have written a macro. please advice the necessary changes
[TABLE="class: cms_table, width: 256"]
<tbody>[TR]
[TD="width: 64"]SheetNAme[/TD]
[TD="width: 64"]Option[/TD]
[TD="width: 64"]Strike[/TD]
[TD="width: 64"]Expiry[/TD]
[/TR]
[TR]
[TD]NIkit[/TD]
[TD]c[/TD]
[TD="align: right"]11200[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]sandeep[/TD]
[TD]P[/TD]
[TD="align: right"]11300[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]Shraddha[/TD]
[TD]c[/TD]
[TD="align: right"]11400[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]NAyan[/TD]
[TD]C[/TD]
[TD="align: right"]11500[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]sansbin[/TD]
[TD]P[/TD]
[TD="align: right"]11600[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
</tbody>[/TABLE]
Sub Macro1()'Sub SearchSheetName()
Dim xName As String
For m = 2 To 6
xName = Worksheets("sheet1").Range("A" & m)
Range(("B" & m), ("D" & m)).Copy
Worksheets(xName).Select
Range("A2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).PasteSpecial
'Selection.Value = Worksheets("sheet1").Range(("B" & m), ("c" & m))
Next m
End Sub
I would like to create a macro where i can paste Columns of Option, Strike and Expiry in respective sheets(sheet name is on left). I have written a macro. please advice the necessary changes
[TABLE="class: cms_table, width: 256"]
<tbody>[TR]
[TD="width: 64"]SheetNAme[/TD]
[TD="width: 64"]Option[/TD]
[TD="width: 64"]Strike[/TD]
[TD="width: 64"]Expiry[/TD]
[/TR]
[TR]
[TD]NIkit[/TD]
[TD]c[/TD]
[TD="align: right"]11200[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]sandeep[/TD]
[TD]P[/TD]
[TD="align: right"]11300[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]Shraddha[/TD]
[TD]c[/TD]
[TD="align: right"]11400[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]NAyan[/TD]
[TD]C[/TD]
[TD="align: right"]11500[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
[TR]
[TD]sansbin[/TD]
[TD]P[/TD]
[TD="align: right"]11600[/TD]
[TD="class: cms_table_xl63, align: right"]27-Jun-19[/TD]
[/TR]
</tbody>[/TABLE]
Sub Macro1()'Sub SearchSheetName()
Dim xName As String
For m = 2 To 6
xName = Worksheets("sheet1").Range("A" & m)
Range(("B" & m), ("D" & m)).Copy
Worksheets(xName).Select
Range("A2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).PasteSpecial
'Selection.Value = Worksheets("sheet1").Range(("B" & m), ("c" & m))
Next m
End Sub