View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Adhiza Adhiza is offline
external usenet poster
 
Posts: 3
Default How can I insert 2 spaces at the beginning of each of 1300 cells?


spaceless in Dallas wrote:
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.