PC Review


Reply
Thread Tools Rate Thread

How to check the value of a Column

 
 
tlee
Guest
Posts: n/a
 
      18th May 2009
Hi all,

How can I check the value of a Column whether string or integer?

Thanks
TLee


 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      18th May 2009
If all the values in a column are text or all the values in a column are
number, then pick a cell and test it:

Sub WellWhatIsIt()
n = Cells(Rows.Count, "Z").End(xlUp).Row
v = Range("Z" & n)
If Application.WorksheetFunction.IsNumber(v) Then
MsgBox ("numbers")
Else
MsgBox ("text")
End If
End Sub

For column Z
--
Gary''s Student - gsnu2007L


"tlee" wrote:

> Hi all,
>
> How can I check the value of a Column whether string or integer?
>
> Thanks
> TLee
>
>
>

 
Reply With Quote
 
tlee
Guest
Posts: n/a
 
      19th May 2009
Hi Gray,

Thanks for your help.

If I would like to check all the cells in Column D such that D2 to D9999,
how can I code it?

TLee



> If all the values in a column are text or all the values in a column are
> number, then pick a cell and test it:
>
> Sub WellWhatIsIt()
> n = Cells(Rows.Count, "Z").End(xlUp).Row
> v = Range("Z" & n)
> If Application.WorksheetFunction.IsNumber(v) Then
> MsgBox ("numbers")
> Else
> MsgBox ("text")
> End If
> End Sub
>
> For column Z
> --
> Gary''s Student - gsnu2007L
>
>
> "tlee" wrote:
>
>> Hi all,
>>
>> How can I check the value of a Column whether string or integer?
>>
>> Thanks
>> TLee
>>
>>
>>

 
Reply With Quote
 
tlee
Guest
Posts: n/a
 
      19th May 2009
Hi Gray,

Please let me refine my question.

I suppose all cells data in Column D is number. If checked it contains
string(even only one cell), then it shows the message ("text")

Thanks
TLee


> Hi Gray,
>
> Thanks for your help.
>
> If I would like to check all the cells in Column D such that D2 to D9999,
> how can I code it?
>
> TLee
>
>
>
>> If all the values in a column are text or all the values in a column are
>> number, then pick a cell and test it:
>>
>> Sub WellWhatIsIt()
>> n = Cells(Rows.Count, "Z").End(xlUp).Row
>> v = Range("Z" & n)
>> If Application.WorksheetFunction.IsNumber(v) Then
>> MsgBox ("numbers")
>> Else
>> MsgBox ("text")
>> End If
>> End Sub
>>
>> For column Z
>> --
>> Gary''s Student - gsnu2007L
>>
>>
>> "tlee" wrote:
>>
>>> Hi all,
>>>
>>> How can I check the value of a Column whether string or integer?
>>>
>>> Thanks
>>> 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 column -A- and fill out column -B- by vba MicrosoftNews Microsoft Excel Programming 3 10th Feb 2008 07:00 PM
Loop through column(s) to check values, perform action based on check ward376 Microsoft Excel Programming 4 6th Nov 2007 03:21 PM
How do I set up a column in Excel as a check mark column? =?Utf-8?B?d3Jzc3RldmVucw==?= Microsoft Excel Misc 7 10th Apr 2007 07:12 PM
How do I put a check box in each row of a column =?Utf-8?B?U3RldmVL?= Microsoft Excel Misc 6 9th Apr 2007 11:22 PM
how to check for recurrence of same names in column 1 and column =?Utf-8?B?SmlsbHlC?= Microsoft Excel Misc 1 30th Jan 2007 02:11 PM


Features
 

Advertising
 

Newsgroups
 


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