Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign values to specific cells in an excel sheet through text file s_pushparaj Excel Discussion (Misc queries) 2 May 11th 08 10:09 PM
Changing a cells type based on it's value Keith Excel Worksheet Functions 2 April 18th 07 01:34 PM
Can I assign a rank based on a cells' value Jason Excel Worksheet Functions 1 March 10th 05 09:54 PM
IF statement based on data type Reed Excel Worksheet Functions 1 January 20th 05 02:17 PM
How do I take data entries and assign them to specific cells that. mike Excel Discussion (Misc queries) 1 December 14th 04 09:51 PM


All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"