Fill blank cells in all named ranges by copying first column in a named range if the first column is not blank

farrukhikram

New Member
Joined
Aug 9, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Dears,

I am having a data set with multiple named ranges with each range having one row and 14 columns. Column 'D' of each named range is always filled, where the copy will be required, ranges with blank 'D' column can be ignored.

What I want to do is to loop through each named range and determine the following:

  • If it is a named range "based on range name as given in column 'B'"
  • If the first column "D" is not empty
  • If the preceding columns 'E:P' are empty
If the above conditions are met, then I want the macro to do the following:

  • Copy The cell (whatever content, formula or value) from column 'D' in all preceding column 'E:P' in that named range.
I am attaching here the 'mimic' screen shot of the data I am working with.

Any help will be highly appreciated.
Ranges.PNG
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Why is nobody replying to my question? is it not clear? we don't necessarily have to work with the named ranges, we can loop through rows and check all non-empty cells in column 'D' then copy and paste the values to column 'E:P' if they are empty.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
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