Convert Cell Contents to text?

mrmagoo_83

Board Regular
Joined
Mar 7, 2005
Messages
82
I am pulling same data from a webpage, and need to convert a few cells, as they are causing issues.

For Example, one of the colums contains names of teams and such, one of the team names is "=V="; however, Excel returns the @NAME? error to me, even though the cell is formatted as text. In order to get the cell's content to show up correctly I have to add a single quote mark in front of the first "=".

Is there a way to either add the quote mark to the beggining of every cell, or to force this cell to show the name correctly, instead of the @NAME?.
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Babydum

Board Regular
Joined
Feb 24, 2005
Messages
164
Try running this macro:

Code:
Sub Test() 

Cells.Replace What:="=v=", Replacement:="'=v=", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False 

End Sub

This is assuming "=v=" is the only team causing you problems.

HTH
 

mrmagoo_83

Board Regular
Joined
Mar 7, 2005
Messages
82
It is not the only one causing the problems :)

I did this instead

Sheets("Teams").Cells(i,2) = "'"&Sheets("Teams").Cells(i,2)

Which worked fine, it just put the " ' " infront of all the teams, which worked great...for now.

Thanks for the help.
 

mrmagoo_83

Board Regular
Joined
Mar 7, 2005
Messages
82
Crud, now that does't work either, darn it. It seems to work for some, but it doens't for others...strange.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,335
Messages
5,571,608
Members
412,407
Latest member
ElmerCC
Top