Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default How to check the value of a Column

Hi all,

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

Thanks
TLee


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to check the value of a Column

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default How to check the value of a Column

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default How to check the value of a Column

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
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
check column -A- and fill out column -B- by vba MicrosoftNews Excel Programming 3 February 10th 08 07:00 PM
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
How do I set up a column in Excel as a check mark column? wrsstevens Excel Discussion (Misc queries) 7 April 10th 07 07:12 PM
how to check for recurrence of same names in column 1 and column JillyB Excel Discussion (Misc queries) 1 January 30th 07 02:11 PM
How do I Make a column in excel a check box column Marie Excel Discussion (Misc queries) 0 November 10th 06 10:42 PM


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

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"