Guanjin Peter
Active Member
- Joined
- May 21, 2008
- Messages
- 429
I just want to select max number of columns to replace '0's with ""
I got the above part....
Using dCount to count the max no. of columns...
I'm stuck on how to select max number of Columns. Because it is by alphabet(a...b...d...e...)
Any idea guys?
I got the above part....
Using dCount to count the max no. of columns...
I'm stuck on how to select max number of Columns. Because it is by alphabet(a...b...d...e...)
Any idea guys?
Code:
Private Sub CommandButton1_Click()
DCount = Range("c2").Value
[COLOR="Red"][B]Column("1:" & DCount & "").Select[/B][/COLOR]
'Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
End Sub
7-Eleven 09 Jul 2008.xls | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | OrderDate: | 09-07-08 | |||||||
2 | DeliveryDate | 09-07-08 | 16 | ||||||
3 | PostingDate | 09-07-08 | |||||||
4 | UnitPrice | ||||||||
5 | ItemNo | RFG-151 | RFG-158 | RFG-152 | RFG-151 | ||||
6 | ProductName | ExternalDocumentNo. | 17212*CHIXROLL&CHEESE | 1729*CALIFORNIATUNA | 1715*CLUBSANDWICH | 1714*ROASTMEXICANECHIX | |||
7 | C0125-112 | 7-ELEVEN112-00*KKWOMENHOS | 0 | 0 | 0 | 0 | |||
8 | C0125-221 | 7-ELEVEN221-00*OWENRD | 0 | 0 | 0 | 0 | |||
9 | C0125-468 | 7-ELEVENSTORE468 | 0 | 0 | 0 | 0 | |||
10 | C0125-195 | 7-ELEVEN195-00*HOANAMBUIL | 0 | 0 | 0 | 0 | |||
11 | C0125-460 | 7ELEVENSTORE460 | 0 | 0 | 0 | 0 | |||
12 | C0125-456 | 7-ELEVENSTORE456 | 0 | 0 | 0 | 0 | |||
Order Template |