Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Excel / Formatting a Cell / Setting a string range

Hello,

Is there anyway to format a cell such that it can have the inputs of
'Y' or 'N'?

At the moment when I tie in a the output from a drop-down menu to a
particular cell, it seems to be converting the 'Y' and 'N' to a '1' and
'2'. It like to keep it at 'Y' and 'N'.

I am assuming that because it would be taking binary inputs, you could
actually act to convert the '1' and '2' to the corresponding 'Y' or 'N,
by writing a simple macro. But I figure there should be a simpler way...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Excel / Formatting a Cell / Setting a string range

Have you looked at using Data-Validation?

For example in VBA to set a validation for range A1:A20

Sub ValRange()
With Range("A1:A20").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="Y,N"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub

--
Cheers
Nigel



wrote in message
oups.com...
Hello,

Is there anyway to format a cell such that it can have the inputs of
'Y' or 'N'?

At the moment when I tie in a the output from a drop-down menu to a
particular cell, it seems to be converting the 'Y' and 'N' to a '1' and
'2'. It like to keep it at 'Y' and 'N'.

I am assuming that because it would be taking binary inputs, you could
actually act to convert the '1' and '2' to the corresponding 'Y' or 'N,
by writing a simple macro. But I figure there should be a simpler way...



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
Setting up formatting for a range of cells [email protected] Excel Discussion (Misc queries) 0 January 4th 07 04:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Setting one cell = to another, INCLUDING FORMATTING. manxman Excel Discussion (Misc queries) 0 May 5th 06 05:20 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Setting named range in VBA- how to set as formula/reference instead of text string? Keith R[_3_] Excel Programming 1 July 28th 03 10:26 PM


All times are GMT +1. The time now is 11:22 AM.

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

About Us

"It's about Microsoft Excel"