#1   Report Post  
One-Leg
 
Posts: n/a
Default VBA forms - HELP!!!

Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
what are you trying to achieve ?

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???



  #3   Report Post  
Don Guillett
 
Posts: n/a
Default

I just recorded the macro6 below but it could be simply

Columns(1).Replace "0", ""

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 12/15/2004 by Don Guillett
'

'
Columns("A:A").Select
Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

--
Don Guillett
SalesAid Software

"One-Leg" wrote in message
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???



  #4   Report Post  
One-Leg
 
Posts: n/a
Default

Hello,

I have many cells with numbers in them and many come up with only a "0" in
them. I want to use a macro that will see the value of the cell and if it is
"0", then I would like to clear the cell. If it's anything else than "0",
nothing should be done!!!

Thanks

"Frank Kabel" wrote:

Hi
what are you trying to achieve ?

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???




  #5   Report Post  
One-Leg
 
Posts: n/a
Default

Hello,

I did that allready but the other cells in colum A that have numbers
(105482102542) in them, the "0" are removed and that is not a good thing...
:-(

Thanks!!!

"Don Guillett" wrote:

I just recorded the macro6 below but it could be simply

Columns(1).Replace "0", ""

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 12/15/2004 by Don Guillett
'

'
Columns("A:A").Select
Selection.Replace What:="0", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

--
Don Guillett
SalesAid Software

"One-Leg" wrote in message
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???






  #6   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
then use 'Edit - Replace' for this

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I have many cells with numbers in them and many come up with only a "0" in
them. I want to use a macro that will see the value of the cell and if it
is
"0", then I would like to clear the cell. If it's anything else than "0",
nothing should be done!!!

Thanks

"Frank Kabel" wrote:

Hi
what are you trying to achieve ?

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???






  #7   Report Post  
One-Leg
 
Posts: n/a
Default

Hello,

Using Edit/Replace does the same thing...

"Frank Kabel" wrote:

Hi
then use 'Edit - Replace' for this

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I have many cells with numbers in them and many come up with only a "0" in
them. I want to use a macro that will see the value of the cell and if it
is
"0", then I would like to clear the cell. If it's anything else than "0",
nothing should be done!!!

Thanks

"Frank Kabel" wrote:

Hi
what are you trying to achieve ?

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???






  #9   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
just check that you want to match the whole cell

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

Using Edit/Replace does the same thing...

"Frank Kabel" wrote:

Hi
then use 'Edit - Replace' for this

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I have many cells with numbers in them and many come up with only a "0"
in
them. I want to use a macro that will see the value of the cell and if
it
is
"0", then I would like to clear the cell. If it's anything else than
"0",
nothing should be done!!!

Thanks

"Frank Kabel" wrote:

Hi
what are you trying to achieve ?

--
Regards
Frank Kabel
Frankfurt, Germany
"One-Leg" schrieb im Newsbeitrag
...
Hello,

I'm using the following in a macro but it doesn't work:

Range("A2:A65536").Select
If Cells.Select = "0" Then Selection.ClearContents

What should I change???








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
border color in forms group box Yvette Excel Discussion (Misc queries) 1 December 11th 04 12:13 AM
Excel 2003 Forms Crash on Tablet PC all other OSs Ok JD Excel Discussion (Misc queries) 0 December 9th 04 12:26 AM
Print margins on forms lchu80 Excel Discussion (Misc queries) 1 December 9th 04 12:01 AM
Group buttons from the forms toolbar GregR Excel Discussion (Misc queries) 1 December 7th 04 02:25 AM
Pointer please KiwiBrian Excel Discussion (Misc queries) 3 November 29th 04 11:09 PM


All times are GMT +1. The time now is 04:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"