Add Beginning Text

C

CB

I have the following in my spreadsheet:
Col A Col B Col C Col D
Address Client TextC1 061
Address Client TextC2 051
Address Client TextC3 041
Address Client TextC4 041
Address Client TextC5 061
Address Client TextC6 051

I need to add to column c textn Dallas every time 061 shows up in col d, St
Louis every time 051 shows up in col d and Nashville every time 041 show up
in col d.

Any one have any suggestions?
 
J

jlclyde

I have the following in my spreadsheet:
Col A      Col B      Col C      Col D
Address  Client      TextC1      061
Address  Client      TextC2      051
Address  Client      TextC3      041
Address  Client      TextC4      041
Address  Client      TextC5      061
Address  Client      TextC6      051

I need to add to column c textn Dallas every time 061 shows up in col d, St
Louis every time 051 shows up in col d and Nashville every time 041 show up
in col d.

Any one have any suggestions?

Your best bet woudl be to ahve a helper column. So in Column E you
woudl have =IF(D1="061",C1&"St Louis,IF(D1="051",C1&"Nashville",IF(so
on and so on

Or you coudl use a macro to go through each cell and if the number =
something then do whatever. I hope this helps.

Jay
 
C

CB

Hi Jay,
Thanks for your help. This is a report that will have to be formatted at a
minimum every week. If I use the formula you suggest I would also have to do
a paste special to get the correct value in the field and delete the extra
columns.
Any idea on how to get a macro to automate this?
Thanks Again,
CB
 
J

jlclyde

Hi Jay,
Thanks for your help.  This is a report that will have to be formatted at a
minimum every week.  If I use the formula you suggest I would also have to do
a paste special to get the correct value in the field and delete the extra
columns.  
Any idea on how to get a macro to automate this?
Thanks Again,
CB








- Show quoted text -

Sub CopyStuff()
Dim Rng As Range
Set Rng = Range("A1", Range("A1").End(xlDown))
Rng.Copy Destination:=Range("B1")
End Sub

This is how you woudl copy all cells in A1: through how many are
filled into column B. I am sure you can use this code to build on.
If you do not know how, open excel and click Alt+F11. Insert a module
into the book that you are working on, add this code and manipulate as
needed. change it to your ranges and so forth. I hope this gets you
on the right track.

Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top