Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to: c.value = "a cell value"
In VBA my macro is this:
Sub test2() RowCount = 1 For Each c In Range("G:G") If c.Value = "P1.Value" Then Cells(RowCount, "R").Value = c.Value Cells(RowCount, "S").Value = c.Offset(0, 1).Value Cells(RowCount, "T").Value = c.Offset(0, 2).Value Cells(RowCount, "U").Value = c.Offset(0, 3).Value Cells(RowCount, "V").Value = c.Offset(0, 4).Value RowCount = RowCount + 1 End If Next End Sub The part that does not seem to work is the line 'If c.Value = "P1.Value" Then' I've tried many different variations to try to get c.Value to check against the value of P1 (which is a date, 07/27/09). How do I get the if statement to check for a match to P1? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION | Excel Discussion (Misc queries) | |||
Empty a cell if the values equal to "IN" , "MC" or "PP" | Excel Programming | |||
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! | Excel Discussion (Misc queries) | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) |