title: VBA: Running macro with filtered rows from excel to Word
body: <p>Here is the macro I've made.</p>
  
  <pre><code>Sub SelectingForWord()
  Dim NomDoc As String, oWord As Word.Application, oDoc As Word.Document
  Dim i As Long
  Dim lastRow As Long
  Dim x As Integer
  
  'open WORD
  Set oWord = CreateObject("word.Application")
  oWord.Documents.Open (ThisWorkbook.Path &amp; "\04_Publi_002_2018.docx")
  oWord.Visible = True
  oWord.Activate
  oWord.Selection.Goto what:=wdGoToBookmark, Name:="FromExcel"
  
  'writing on my word document
  With oWord.Selection
  'lastRow = Sheets("BASE").Range("A" &amp; Rows.Count).End(xlUp).Row
  'lastRow = Sheets("BASE").Range(xlCellTypeVisible).Count
  
  'find last row
  lastRow = Sheets("BASE").Range("A" &amp; Rows.Count).End(xlUp).Row
  x = lastRow
  
  'count visible rows
  RowCount = Range("a1:a" &amp; x).Rows.SpecialCells(xlCellTypeVisible).Count - 1
  
  For i = 2 To RowCount      
   'Doing things to print in Word
          .TypeText Cells(i, 1) &amp; Chr(9) &amp; Cells(i, 2) &amp; " " &amp; Cells(i, 3) &amp; " (" &amp; Cells(i, 5) &amp; "-" &amp; Cells(i, 18) &amp; ") and " &amp; Cells(i, 15) &amp; " " &amp; Cells(i, 16) &amp; Chr(9) &amp; Cells(i, 14) &amp; Chr(9) &amp; Cells(i, 13)
          .TypeParagraph
  Next i
  End With
  End Sub
  </code></pre>
  
  <p>I've filtered information manually and I would like to print the selected rows to word only. Unfortunately, this macro always starts from the line 1.
  How can I print in Word only the selected lines?
  Thx for your help.</p>