Autofill down to first non-empty cell across multiple columns

sdspieg

Board Regular
Joined
Dec 9, 2013
Messages
98
Please look at the cells below - I would like to be able to use autofill over this whole range in such a way that the first new non-empty-cell is autofilled downward until it find a new new non-empty-cell. And that across columns - whereby the amount of cells to be autofilled will vary. Can anybody help? Thanks much

EUR-RUS - all groups.xlsx
KLM
130Q1. How do you assess the influence of the following actors on Russia (irrespective of domains or scenarios)?Q1.1. ChinaQ1.1.1. today
131Q1.1.2. in 2025
132Q1.1.3. in 2030
133Q1.1.4. in 2040
134Q1.2. European UnionQ1.2.1. today
135Q1.2.2. in 2025
136Q1.2.3. in 2030
137Q1.2.4. in 2040
138Q1.3. IndiaQ1.3.1. today
139Q1.3.2. in 2025
140Q1.3.3. in 2030
141Q1.3.4. in 2040
142Q1.4. JapanQ1.4.1. today
143Q1.4.2. in 2025
144Q1.4.3. in 2030
145Q1.4.4. in 2040
146Q1.5. United StatesQ1.5.1. today
147Q1.5.2. in 2025
148Q1.5.3. in 2030
149Q1.5.4. in 2040
150Q2. Will Europe be able to influence future Russia's? Q2.1. PoliticalQ2.1.1. Putinism forever
151Q2.1.2. Stalinism on AI steroids
152Q2.1.3. Raspad
153Q2.1.4. (Re-?) Turn to Europe
154Q2.2. SocialQ2.2.1. Putinism forever
155Q2.2.2. Stalinism on AI steroids
156Q2.2.3. Raspad
157Q2.2.4. (Re-?) Turn to Europe
158Q2.3. MilitaryQ2.3.1. Putinism forever
159Q2.3.2. Stalinism on AI steroids
160Q2.3.3. Raspad
161Q2.3.4. (Re-?) Turn to Europe
162Q2.4. DiplomaticQ2.4.1. Putinism forever
163Q2.4.2. Stalinism on AI steroids
164Q2.4.3. Raspad
165Q2.4.4. (Re-?) Turn to Europe
166Q2.5. InformationalQ2.5.1. Putinism forever
167Q2.5.2. Stalinism on AI steroids
168Q2.5.3. Raspad
169Q2.5.4. (Re-?) Turn to Europe
170Q2.6. EconomicQ2.6.1. Putinism forever
171Q2.6.2. Stalinism on AI steroids
172Q2.6.3. Raspad
173Q2.6.4. (Re-?) Turn to Europe
174Q2.7. InfrastructuralQ2.7.1. Putinism forever
175Q2.7.2. Stalinism on AI steroids
176Q2.7.3. Raspad
177Q2.7.4. (Re-?) Turn to Europe
178Q3. Which of the following 4-level ways of ‘structuring’ Europe’s influence/ing option space do you find more useful for our policy trade-off analysis? Please fol2 the link to find the information on each of the approaches to influencing Q3.1. ‘Energy-based'
179Q3.2. Tactics-based
180Q3.3. Style-based
181Q3.4. Principle-based
182Q3.5. Functional domain-based
183Q3.6. Target-based
EUR-RUS - all groups-nu-Tableau
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
with this macro, you take the value of the cell above the empty cell and afterwards replace it with the value. If you have columns or ranges with (other) formulas, you have to exclude them.
VBA Code:
    With Sheets("MySheet").UsedRange
          MsgBox " range is " & .Address
          .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
          .Value = .Value
     End With
 
Upvote 0
with this macro, you take the value of the cell above the empty cell and afterwards replace it with the value. If you have columns or ranges with (other) formulas, you have to exclude them.
VBA Code:
    With Sheets("MySheet").UsedRange
          MsgBox " range is " & .Address
          .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
          .Value = .Value
     End With
Thanks @BSALV. But I obviously don't WANT to exclude these other columns. And there are only survey data values in these cells, not a single formula. I found this macro, and I manually applied it to these three columns. And that did the trick. But shouldn't it be possible to build a macro that this ACROSS columns? Thanks!
 
Upvote 0
Thanks @BSALV. But I obviously don't WANT to exclude these other columns. And there are only survey data values in these cells, not a single formula. I found this macro, and I manually applied it to these three columns. And that did the trick. But shouldn't it be possible to build a macro that this ACROSS columns? Thanks!
Did you try @BSALV's code ? It is doing all columns in the Used Range.
What is it not doing that you need it to do
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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