logo elektroda
logo elektroda
X
logo elektroda

[EXCEL] Add Apostrophe to All Cells at Once: Efficient Solution for 2500+ Lines Input

Marcin_Sk 18179 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 8289731
    Marcin_Sk
    Level 10  
    Hello !

    I have a problem, due to excel seeing a cell as text by prefixing that text with an apostrophe, i need a solution how to add an apostrophe automatically to all cells at once. I have about 2500 lines and I don't really want to enter it manually for each one. Thanks in advance
  • ADVERTISEMENT
  • #2 8289969
    marcinj12
    Level 40  
    And the convert to text function =TEXT(A1, "0") is not enough?
  • ADVERTISEMENT
  • #3 8290091
    Marcin_Sk
    Level 10  
    I haven't tried... I'll check and let you know. Thanks for the help
  • ADVERTISEMENT
  • #4 8296917
    wrych
    Level 20  
    I'd like to run the following function in VBA:
    Function apostrof()
    For i = 1 To 30
    For j = 1 To 5
    Cells(i, j).Value = Chr(39) + CStr(Cells(i, j).Value)
    Next j
    Next i
    End Function

    Of course, the range for i, j is set according to your needs.
  • #5 8367675
    walek33
    Level 29  
    :arrow: imminent
    Have you tried activating this function?

    Added:

    For simplicity, I'll add that it should be Sub and not Function. :D Correct me if I'm wrong.
ADVERTISEMENT