Automate cut/paste functions - Help!

G

Guest

I am trying to fill in certain information in a column using the cut/paste
function. Specifically I’m copying the contents of cell C4 and pasting it
into C5:C7. Now in cell C8 there is a new text that needs to be copied into
C9:C15… then new text in C16 etc etc.. The spacing varies greatly in how many
I have to paste but this repeats for about 25,000 lines or so. Does anyone
have a suggestion on how I can automate this? Please help!!
Thanks!
 
G

Guest

If it is a non equaiton you want copied, I would probably use a quick macro
similar to

sub fl()
for r = 4 to 25000
if cells(r,3)<>"" then xx=cells(r,3) else cells(r,3)=xx
next r
end sub
 
M

Myrna Larson

If I understand your layout correctly, and cells C5:C7, C9:C15, C17:??? etc,
are now blank, do this.

Select all of column C, then Edit/Goto, click the Special button and select
Blanks. One of the empty cells will be the active cell (should be C5 if my
assumptions are correct). In that cell, type an equal sign, point to the cell
above it with the mouse, and press CTRL+ENTER. If the first cell was C5, then
it will contain the formula =C4, cell C6 will have the formula =C5, etc.

To convert these formulas to their values, now select all of column C and
Edit/Copy. Without changing the selection, Edit/Paste Special and select the
Values option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top