LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Using Select Case on Single column only

I'm writing code to standardize a report I get from someone.

1. I need to change the single character value in each cell to the
actual name using Select Case
Example if cell value = B then "Bacon"
else if value = C then "Cheese"
else if value = E then "Eggs"
etc

I've gotten the following code using example found here but I'm stuck
on
defining my column range. My code works as long as there are no blank
cells.

and how do I use test each cell and stop at last cell of column even
if there is a blank row.

My code Start
Sub FixReport()
Dim ColNum As Long
Dim RngHeaders As Range
Dim RngColumn As Range
Dim ColHeader As String
'Set the rng of the column headers
Set RngHeaders = Range("A4", Cells(1,
Columns.Count).End(xlToLeft))
'Get the column header to search for
ColHeader = "ThisColumn"
'Find the column number of the column
ColNum = RngHeaders.Find(What:=ColHeader, LookAt:=xlWhole).Column
Set RngColumn = Range(Cells(5, ColNum), Cells(5,
ColNum).End(xlDown))
MsgBox RngColumn.Address ' For testing
End Sub
My code End

Thanks
Steve
 
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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
how to select a single column when this column cross a merged cell cnEagle Excel Programming 1 November 13th 07 04:49 AM
Cannot select single column to the left of freeze Ake Excel Programming 5 October 26th 06 11:39 AM
Single Column select Daniel Q. Excel Discussion (Misc queries) 4 October 18th 06 10:07 PM
Changing single column default to Upper case Graham Excel Discussion (Misc queries) 4 September 27th 05 05:17 PM


All times are GMT +1. The time now is 04:45 PM.

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"