When copying a table from Excel to Word - omit row from a table if cell in first column is empty

Habo

New Member
Joined
Jan 25, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Have seen some similar questions but have not been able to solve my particular problem.

I have a given (non-changing) range, lets say N2:T9. Based on user input, one or more of the cells N3 to N8 might be "empty" (i.e. a formula returns no text).

My goal is to copy this range N2:T9 as a table into word, but omit the lines where column A is empty. Note that the range is not sorted, so the empty cells can be one or more, scattered between A1 and A7.

As of now, I define the whole range as a table and it is pasted into my word template. But it would be nice to exclude the empty rows from the range before pasting.

PS: Just started with VBA ;)
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Edit;

"Note that the range is not sorted. I.e. the empty cells can be one or more, scattered between A1 and A9. A1 and A9 will always have a text and should thus always be included in the range"
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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