how to populate a 3rd column with with data from 1st or 2nd colum

L

leo

I have 3 columns of numbers:A,B,C. I want to populate column C with the
number in column A only if there is no number in column B

example
A B C
1 blank 1
2 3 3
 
G

Guest

Hi

Try this in column C:
=IF(B2="",A2,"")
What do you want in C if B contains a number? If it is B, try this one:
=IF(B2="",A2,B2)

Hope this helps.
Andy.
 
G

grahammal

Sub Button1_Click()
10 For a = 1 To 1000
20 If Sheets("Sheet1").Range("A" & a) = "" Then r = a - 1: GoTo 40 Els
GoTo 30 ' Looks for end of list
30 Next a
40 For b = 1 To r
50 If Sheets("Sheet1").Range("B" & b) = "" The
Sheets("Sheet1").Range("C" & b) = Sheets("Sheet1").Range("A" & b)
60 Next b
End Su
 
Top