Muhammad_Bilal
New Member
- Joined
- Sep 1, 2017
- Messages
- 14
I am working on 'Word Document' where a text is selected and converted into variable let say CCC.
I want to transfer this CCC to 'Excel Workbook' Sheet1 in next empty row.
I am trying following code but it seem not doing anything:
Before that I was using following code which was working fine and I want to improve it so:
I want to transfer this CCC to 'Excel Workbook' Sheet1 in next empty row.
I am trying following code but it seem not doing anything:
Code:
Set CCC= Selection.Range.PARAGRAPHS(1).Range
Set MyXL = CreateObject("Excel.Application")
MyXL.Visible = True
Set eXwb = MyXL.Workbooks.Open("C:\Users\dell\Desktop\WEBD\LIST.xlsm")
With eXwb.Application
.Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).FormulaR1C1 = CCC
End With
Before that I was using following code which was working fine and I want to improve it so:
Code:
With eXwb.Application
.Sheets("Sheet1").Select
.ActiveCell.FormulaR1C1 = CCC
.ActiveCell.Offset(1, 0).Range("A1").Select
End With