Copy Selected cell to the length of specific column

HotNumbers

Well-known Member
Joined
Feb 14, 2005
Messages
732
How can i copy an active cell to the length of a specific cell. For example I want to copy H119 but would like to stop at the exact length of Column C which happens to be 335. But the length of Column C is always changing.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
This may be a start:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>        i = Cells(Rows.Count, "C").End(xlUp).Row<br>        <br>        ActiveCell.Copy Range(ActiveCell, Cells(i, ActiveCell.Column))<br>        <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0
How can i copy an active cell to the length of a specific cell. For example I want to copy H119 but would like to stop at the exact length of Column C which happens to be 335. But the length of Column C is always changing.

Do you mean to say you want to copy the activecell which is H119 to the last row in column C?

Code:
sub CopyToColumnC()
ActiveCell.Copy Destination:=Range("C1048576").End(xlUp).Offset(1, 0)
End sub
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

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