How can I insert 2 spaces at the beginning of each of 1300 cells?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Rather than go through each of 1300 cells in a column to add a ' and 2
spaces, so that the column will match up when I import it into Access, how
can I quickly add 2 spaces to the left of the text data in each column?
 
spaceless in Dallas said:
Rather than go through each of 1300 cells in a column to add a ' and 2
spaces, so that the column will match up when I import it into Access, how
can I quickly add 2 spaces to the left of the text data in each column?

A helper column =" "&A1
(with 2 spaces between the quote marks)
 
Format the column for Custom and use space space @ as the format type
Hard to type an example, <g> but maybe (__@) without the parenthesis and
replacing the underscores with spaces....whew


Vaya con Dios,
Chuck, CABGx3
 
spaceless said:
Rather than go through each of 1300 cells in a column to add a ' and 2
spaces, so that the column will match up when I import it into Access, how
can I quickly add 2 spaces to the left of the text data in each column?

Another way is to write a quick bit of vb to do the work for you.
example:

Sub addSpaces()
Dim x, y As intergers
For x = 1 To 5 '(how ever rows you need to cover)
For y = 1 To 6 '(how ever many columns you need to cover)
ActiveSheet.Cells(x, y).Value = "' " & ActiveSheet.Cells(x,
y).Value
Next y
Next x
End Sub

should also note that your starting point for x and y should be the
reference to where the first cell of the data is at.
 

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

Back
Top