VBA help selecting excel rows with data and exporting to word

crvazquez954

New Member
Joined
Jul 9, 2019
Messages
23
Hi,

I have a spreadsheet I am preparing for my boss that requires me to review column B (B28:B47) on the "Summary" sheet, determine which rows have data and transfer a portion of the rows (columns B, C, D, E & F) to a word template called "Proposal". I have limited experience with VBA but I know I need a macro code in order to do this. Can anyone help me write an easy code that does this for me? I appreciate any help.

Thanks
 
Dante you are awesome!!! With your help I was able to tweak it and get it to work perfectly. I adjusted the line in the "For Each" statement to read:

"If WorksheetFunction.Count(r) = 0 Then r.Hidden = True"

I then recorded a macro to remove and restore the formatting and added it before and after the "For Each" Statement. I also added a statement near the end of the code to restore the hidden rows. Below is a copy of the code to help anyone else who may have the same issue.

I´m glad to help you. Thanks for the feedback.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,224,822
Messages
6,181,165
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