Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a data type to specific cells based on IF stmt...
I think this is what you want:
R = 2 Do While Not (IsEmpty(Cells(R, 6))) If Not IsEmpty(Cells(R, 1)) And Not IsEmpty(Cells(R, 3)) And IsEmpty(Cells(R, 2)) Then Cells(R, 2).Value = "XXXXX" End If R = R + 1 Loop HTH -- Michael J. Malinsky "Chris Powell" wrote in message ... I import data into my worksheet from another Excel file and after the import is complete, each cell in col B is assigned the type "text" (confirmed using TYPE function). In the event that no value is found in a particular row in Col B., the TYPE function indicates that it's type "number". I want to place a string "XXXXXXXXXX" in all rows where col. B is empty AND where Cols. A and C have a value. I want to use the following simple IF condition: R = 2 Do While Not (IsEmpty(Cells(R, 6))) If Not IsEmpty((Cells(R, 1)) And (Cells(R, 3))) And IsEmpty(Cells(R, 2)) Then ' code needed here! End If R = R + 1 Loop When I try to assign a value and run the code, I get a type mismatch error code 13. How can I either: (a) reassign the data type to text in any cell where Col. A and C have a value AND Col B is empty or (b) simply reassign the data type for all cells in Col B to text? This way, I can put a "XXXXXXXXXX" string in the desired cells... Thanks much in advance! Chris *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign a data type to specific cells based on IF stmt...
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
assign values to specific cells in an excel sheet through text file | Excel Discussion (Misc queries) | |||
Changing a cells type based on it's value | Excel Worksheet Functions | |||
Can I assign a rank based on a cells' value | Excel Worksheet Functions | |||
IF statement based on data type | Excel Worksheet Functions | |||
How do I take data entries and assign them to specific cells that. | Excel Discussion (Misc queries) |