Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: format column as text, and replace all 1's as 0001

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Sydney/Brisbane , Australia
    Posts
    542
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    how can i on opening a macro replace all the 1's in column k with reformatting as text and then 0001. The number of 1's can very from 25 lines to 2000 lines. Its a csv file and currently on opening its changing the cells from text to general.

    URGENT assistance is required. thankyou all

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Sydney/Brisbane , Australia
    Posts
    542
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    i've done it using the following elcheapo formula, thanks anyways.

    Sub quickreplace()
    Dim c As Range
    With ActiveSheet
    Columns("k:k").Select
    Selection.NumberFormat = "@"
    For Each c In .Columns(11).Cells
    If c.Value = "1" Then 'If the cell above is not the same
    c.Value = "0001"
    Else
    End If
    Next c
    End With
    End Sub

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •