autofill with same value of a cell for a specific number of varing rows

cirugio

Board Regular
Joined
Mar 30, 2010
Messages
130
I am trying to build some VB code which will copy the value the asof_date field (i.e. 8/22/2014) and fill in that same value for the entire column. I tried recording it, but it autofills all the rows in the entire column A in the spreadsheet when I only want it to fill the same value for the number of rows I have populated in column b or c. For instance the example below I just want it copy 8/22/2014 for the remaining 6 rows (rows vary each day). Any thoughts on how to code this. I tried rows.count but its not working. Any help is appreciated. Thanks.


column A B C
asof_date
(ET)
Balance
08/22/2014
21:00
15,287,088
21:01
15,287,088
21:02
15,315,820
21:03
15,315,845
21:04
15,315,933
21:05
15,315,950
21:06
15,316,050

<TBODY>
</TBODY>



results I am seeking:

asof_date</SPAN>
(ET)</SPAN>
Balance</SPAN>
08/22/2014</SPAN>
21:00</SPAN>
15,287,088</SPAN>
08/22/2014</SPAN>
21:01</SPAN>
15,287,088</SPAN>
08/22/2014</SPAN>
21:02</SPAN>
15,315,820</SPAN>
08/22/2014</SPAN>
21:03</SPAN>
15,315,845</SPAN>
08/22/2014</SPAN>
21:04</SPAN>
15,315,933</SPAN>
08/22/2014</SPAN>
21:05</SPAN>
15,315,950</SPAN>
08/22/2014</SPAN>
21:06</SPAN>
15,316,050</SPAN>

<TBODY>
</TBODY>
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Code:
Range("A2:A" & Cells(Rows.Count, "B").End(xlUp).Row).value = Range("A2").value

Assuming your table is in A1 and there is no data after "21:06: in column B.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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