ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy down to next Cell (https://www.excelbanter.com/excel-discussion-misc-queries/154104-copy-down-next-cell.html)

[email protected]

Copy down to next Cell
 
I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam


Gary''s Student

Copy down to next Cell
 
try this macro:

Sub samc()
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = 3 To n
If (IsEmpty(Cells(i, "B"))) Then
Cells(i, "B").FillDown
End If
Next
End Sub

--
Gary''s Student - gsnu200737


" wrote:

I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam



MartinW

Copy down to next Cell
 
Hi Sam,

If I understand you correctly,

Insert a helper column C
Put this in C2
=IF(B20,B2,C1)
and drag down to the end of your data.

Then select column C do a copypaste specialvalues
on it and then delete column B.

HTH
Martin

wrote in message
ups.com...
I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam




Gord Dibben

Copy down to next Cell
 
Select column B2 then SHIFT + End + Downarrow then F5SpecialBlanksOK

Enter an = sign in active cell which should be B3

Point or arrow up to B2 and CRTL + ENTER

Copy then paste specialvaluesOKEsc


Gord Dibben MS Excel MVP

On Tue, 14 Aug 2007 06:59:11 -0700, wrote:

I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam



Gord Dibben

Copy down to next Cell
 
Make that "select B2 then.........."


Gord

On Tue, 14 Aug 2007 07:59:19 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

Select column B2 then SHIFT + End + Downarrow then F5SpecialBlanksOK

Enter an = sign in active cell which should be B3

Point or arrow up to B2 and CRTL + ENTER

Copy then paste specialvaluesOKEsc


Gord Dibben MS Excel MVP

On Tue, 14 Aug 2007 06:59:11 -0700, wrote:

I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam



challa prabhu

Copy down to next Cell
 
Hi,

Do the following:
1. Enter a value in cell B2. (for example, enter 22)
2. Select a range from B2:B20.
3. Press Ctrl+D.
4. Repeat the Step 1 to Step 3 after entering a new value in cell 23.

Challa Prabhu

" wrote:

I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam




All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com