Transfer Text from Word to Excel in next row available

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:


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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Without wanting to place to fine a point on it, your 'improvement' is anything but. Working with Selections is far less efficient than working with Ranges and is prone to creating a lot of screen flicker.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top