Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Junior Member
 
Location: Oklahoma
Posts: 6
Default prefixing a cell?

I have a simple question.
I have a column in a spreadsheet where some rows start with the letter
Q, and some do not. I'd like to update the rows so that column is
prefixed with the letter Q on every row.
Is there a way to do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default prefixing a cell?

Sub AddQ()
Dim i As Long

For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
If Cells(i,"A").Value < "" Then
If Left(Cells(i,"A").Value,1) < "Q" Then
Cells(i,"A").value = "Q" & Cells(i,"A").value
End If
End If
Next i
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"HockeyFan" wrote in message
ups.com...
I have a simple question.
I have a column in a spreadsheet where some rows start with the letter
Q, and some do not. I'd like to update the rows so that column is
prefixed with the letter Q on every row.
Is there a way to do this?



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
Prefixing a number to the number in a cell Sherees Excel Discussion (Misc queries) 2 December 13th 09 09:32 PM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Merging 2 cells together and prefixing fuzzyjon Excel Worksheet Functions 7 May 12th 06 04:27 PM
Prefixing a selection of cells with zeros Louise Excel Worksheet Functions 2 April 4th 06 02:32 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 11:50 PM.

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"