autofill of sorts

G

Guest

Hello! I have a one to many relationship betweent the value in column A and
the value in column B. The value ia column A is "displayed" for each unique
occurence.
I would like to populate this value in column A for each occurence of B.

Selecting the lower right hand corner of the cell in column A and dragging
until the next value in column A works very nicely but I need to do this
literally thousands of times...any possible solutions would help.
 
G

Guest

can you give a little more detailed example. So for all similiar values in
Column B you would like Column A to have a similiar value?
 
G

Guest

Sure! Thanks for the quick response...

My sheet looks like this...

horse naround
play
ofcourse
shark bait
land
sea biscuit
saw
scallop

and I want it to look like this...

horse naround
horse play
horse ofcourse
shark bait
shark land
sea biscuit
sea saw
sea scallop
 
R

Ragdyer

Say your list is in Column A.
Select from A1 down to the row number that contains your last entry in
Column B.

Then:

Hit <F5>
Click "Special"
Click "Blanks"
Then <OK>
Type the equal ( = ) sign
Hit the UP Arrow
Hold down <Ctrl> and hit <Enter>.

And you're done!
 
G

Guest

Try this... Go to Tools----> Macro----> Visual Basic Editor

Then go to Insert---> Module

Then copy and paste this code in to it

Sub Horse()

Do Until ActiveCell.Offset(1, 1).Value = ""

If ActiveCell.Value <> 0 Then
ActiveCell.Copy

If ActiveCell.Offset(1, 0).Value = "" Then
ActiveCell.Offset(1, 0).PasteSpecial

Else: ActiveCell.Offset(1, 0).Activate

End If

Else: End If

Loop

End Sub

Select the first value in Column A and Go To ---> Tools ---> Macro ---->
Macros
And select the Macro Horses and press Run

Make sure that their are NO blanks in Column B's data set. If there are I
will have to update the code. And make sure the active cell is the first cell
with a value in column A. It should work. LMK
 

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

Similar Threads

retrieving values from a certain column 2
AutoFill 1
collapse rows into one 2
SUBTOTAL QUERY 5
Dynamic List Data Validation 5
If andf countif 1
Macro for Calendar 1
Comparison of columns and calculate differences 1

Top