Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add Beginning Text
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? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add Beginning Text
On Apr 29, 2:44*pm, CB wrote:
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add Beginning Text
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 "jlclyde" wrote: On Apr 29, 2:44 pm, CB wrote: 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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add Beginning Text
On Apr 29, 3:35*pm, CB wrote:
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 "jlclyde" wrote: On Apr 29, 2:44 pm, CB wrote: 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- Hide quoted text - - 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I replace a ' at the beginning of a text cell using Replace | Excel Discussion (Misc queries) | |||
Can I match the beginning of text in an Excel cell? | Excel Discussion (Misc queries) | |||
Removing numbers from the beginning of a text string | Excel Worksheet Functions | |||
How to reformat numbers stored as text (apostrophe at beginning) | Excel Discussion (Misc queries) | |||
add characters to beginning of text | Excel Worksheet Functions |