![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|