0

I'm trying to convert all data in column B , which currently are integers ex. 26, to text format, ex "26". I have tried the following:

Dim index As Long

index = 2

Do While index_5 <> NewResizeRange

   Worksheets("Source").Cells(index, "B").Value = CStr(Worksheets("Source").Cells(index, "B").Value)

   index = index + 1

Loop

Which turned to be extremely slow and ineffective.

I also tried:

Sub Macro8()

   Columns("E:E").Select
   Selection.TextToColumns Destination:=Range("Table1[[#Headers],[Column5]]"), _
    DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter _
    :=False, Tab:=True, Semicolon:=False, Comma:=False, Space:=False, _
    Other:=False, FieldInfo:=Array(1, 2), TrailingMinusNumbers:=True
End Sub

Problem is that when the data comes from another worksheet and the cell is refering to said worksheet it is only displaying the location of the data in the cell.

Any ideas?

5
  • Does it need to be a VBA solution? Commented Jul 3, 2017 at 14:58
  • 3
    have you tried to just change the format of the range .NumberFormat = "@" ? Commented Jul 3, 2017 at 14:58
  • @Nathan_Sav no not really, never seen it before! Commented Jul 4, 2017 at 6:54
  • @MrDogme yes, it has to be Commented Jul 4, 2017 at 8:30
  • @Nathan_Sav It did not work. A1 = 15 and A1="15" is still givning me false Commented Jul 4, 2017 at 9:12

2 Answers 2

1

is this what you looking for?

Range("B1:B288889").NumberFormat = "@"

Cheers

Elmnas

Sign up to request clarification or add additional context in comments.

1 Comment

Not really because If B2=15 and I use .NumberFormat = "@" then B2="15" is still false. @DanielElmnas
1

Try this then:

Range("D1:D999999").FormulaR1C1 = "=TEXT(RC[-3],""0"")"
Range("D1:D999999").Copy 
Range("A1:A999999").PasteSpecial Paste:=xlPasteValues

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.