Hi
I am having problems with a value check.
Basically:
I have pulled data from a csv file into my workbook. During this cut'n'paste exersize I have found that some values are n/a.
When this happens I want the value of the cell 4 to the right (on the same row) to replace the n/a.
for example:
Here Q8 and S8 have n/a values I want Q8 to be 66 and S8 to be 12
My code for doing this is:
the module compiles ok and runs though it ok
checking the values they are correct but the cell does not update
any ideas
Martin
I am having problems with a value check.
Basically:
I have pulled data from a csv file into my workbook. During this cut'n'paste exersize I have found that some values are n/a.
When this happens I want the value of the cell 4 to the right (on the same row) to replace the n/a.
for example:
Excel Workbook | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | |||
8 | 25/10/2009 | 1071 | MSCHI050 | MS Chillies Mixed 50g | 800 | 66 | 12 | n/a | n/a | Orange | UL | Genovese | 3090 | 000 3090 0000 | 40122 | 19823 | 268596 | 1 | |||||||||||||||||||||
inDATA |
Here Q8 and S8 have n/a values I want Q8 to be 66 and S8 to be 12
My code for doing this is:
Code:
For Each Colour In TestForColour.Cells
If Colour.Value <> "" Then
Intersect(ActiveCell.EntireRow, Columns("A:AJ")).Copy
wbThis.Activate
Sheets("PROPHETDATA").Select
Selection.PasteSpecial Paste:=xlPasteValues
If (ActiveCell.EntireRow.Value2(1, 17)) = "n/a" Then ActiveCell.EntireRow.Value2(1, 17) = ActiveCell.EntireRow.Value2(1, 13)
If (ActiveCell.EntireRow.Value2(1, 19)) = "n/a" Then ActiveCell.EntireRow.Value2(1, 19) = ActiveCell.EntireRow.Value2(1, 15)
Range("A" & A).Select
ActiveCell = DateValue(ArrivalDate)
A = A + 1
Range("B" & A).Select
ActiveWindow.ActivatePrevious
End If
b = b + 1
Range("U" & b).Select
Next Colour
checking the values they are correct but the cell does not update
any ideas
Martin