Data Fill in VB?

  • Thread starter Thread starter Carrie_Loos via OfficeKB.com
  • Start date Start date
C

Carrie_Loos via OfficeKB.com

I have a worksheet with names in the first row and I used a look up formula
to gather data from another sheet that signifies dates (this ties in with the
rest of my workbook and how it behaves so has to remain this way) so
basically I have columns with 1's and 2's in them otherwise blank spaces.

1=begin date and 2=end date. I want to find the 1's in each column and fill
in with a 1 in between the 1 and 2 as well as changing the 2 to a one. What I
need is a string of 1's.

I have looked at a couple of data fill examples and it appears to be the way
to go but I need help with this.

Thanks in advance
Carrie
 
A sheet formula solution:
say col A has
Adam
b
b
1
b
b
2
b
b
etc .
where b's are blanks. Then put the following in B2
=IF(OR(MAX(A$2:A2)=1,A2=2),1,"")
and copy down and this will give you your 1's which
you could copy and paste special back to col A.

A VBA macro should be easy. Do you have a start? Dave D-C
 
Great -

I can wirte this in a flash. I have never used the approach of using a
formula to think about and then write the macro......Love to learn new
approaches. Thx

A sheet formula solution:
say col A has
Adam
b
b
1
b
b
2
b
b
etc .
where b's are blanks. Then put the following in B2
=IF(OR(MAX(A$2:A2)=1,A2=2),1,"")
and copy down and this will give you your 1's which
you could copy and paste special back to col A.

A VBA macro should be easy. Do you have a start? Dave D-C
I have a worksheet with names in the first row and I used a look up formula
to gather data from another sheet that signifies dates (this ties in with the
[quoted text clipped - 10 lines]
Thanks in advance
Carrie
 

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

Back
Top