PC Review


Reply
Thread Tools Rate Thread

Check the two different cells in the same row

 
 
tlee
Guest
Posts: n/a
 
      5th Jun 2009
Hi all,

Could anyone tell me how to check all cells of the same column by the
following conditions:

1) if the cell (D5) is blank and the cell (A5) is not blank, then fill data
into D5

2) if the cell (D5) is blank and the cell (A5) is blank, then no need to
fill anything


Thanks for in advance.

Tlee

 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      5th Jun 2009
It is simplier just to move a into d if a is blank or if a is not blank.

sub CheckColumns

RowCount = 1
Do while Range("A" & RowCount) <> ""
if Range("D" & RowCount) = "" then
Range("D" & RowCount) = Range("A" & RowCount)
end if

RowCount = RowCount + 1
loop

end sub

"tlee" wrote:

> Hi all,
>
> Could anyone tell me how to check all cells of the same column by the
> following conditions:
>
> 1) if the cell (D5) is blank and the cell (A5) is not blank, then fill data
> into D5
>
> 2) if the cell (D5) is blank and the cell (A5) is blank, then no need to
> fill anything
>
>
> Thanks for in advance.
>
> Tlee
>
>

 
Reply With Quote
 
tlee
Guest
Posts: n/a
 
      5th Jun 2009
Hi Joel,

Many thanks for your help!!!

Tlee


> It is simplier just to move a into d if a is blank or if a is not blank.
>
> sub CheckColumns
>
> RowCount = 1
> Do while Range("A" & RowCount) <> ""
> if Range("D" & RowCount) = "" then
> Range("D" & RowCount) = Range("A" & RowCount)
> end if
>
> RowCount = RowCount + 1
> loop
>
> end sub
>
> "tlee" wrote:
>
>> Hi all,
>>
>> Could anyone tell me how to check all cells of the same column by the
>> following conditions:
>>
>> 1) if the cell (D5) is blank and the cell (A5) is not blank, then fill
>> data
>> into D5
>>
>> 2) if the cell (D5) is blank and the cell (A5) is blank, then no need to
>> fill anything
>>
>>
>> Thanks for in advance.
>>
>> Tlee
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check 3 cells, only one of the cells my be filled Peter Jonkers Microsoft Excel Worksheet Functions 7 13th Jul 2009 01:39 PM
Check 1 cells value and use the result to change another cells for BigAl Microsoft Excel Programming 1 23rd Dec 2008 08:09 AM
check value into cells =?Utf-8?B?TWFpbGVlbg==?= Microsoft Excel Misc 2 7th Dec 2004 04:45 PM
How can I check 2 cells? Aversin Microsoft Excel Misc 1 15th Jun 2004 08:25 PM
Check Cells are EXACTLY the Same Chris Adams Microsoft Excel Programming 2 24th May 2004 03:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:45 AM.