Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro Not Working

Select column B

then do
Edit=Goto=.Special

Select Constants or Formulas and the options you want below that.

then click OK

The next Step would be to do Edit=Delete and select entirerow.

This is what the code does. You don't need anything else. Decide which
line (lines) of code you need.

--
Regards,
Tom Ogilvy

"Marilyn" wrote in message
...
Tom,

should i incorporate the code you gave me to the macro I was trying to
create or should i just use the code you suggested alone. I'm not sure
how
to proceed with what you have suggested.

Thanks again for the quick response.

"Tom Ogilvy" wrote:

you have a couple of choices

sub DeleteRows()
on Error Resume Next
columns(2).specialCells(xlBlanks).EntireRow.delete
columns(2).SpecialCells(xlformulas,xlNumbers)
columns(2).specialCells(xlformulas,xlTextValues)
columns(2).SpecialCells(xlConstants,xlNumbers)
columns(2).SpecialClels(xlConstants,xlTextValues)
On Error goto 0
End sub

remove the ones you don't want. There is also an xlErrors, but you said
you
wanted to keep those.

--
Regards,
Tom Ogilvy



"Marilyn" wrote:

Thanks for the quick response Tom. I have two columns and column B is
the
column I want to test for. Some of the cells in that column contains
numbers
and the other cells are set to (#value) I want my macro to delete the
rows
where the cell content is an actual value and i want to leave the ones
that
are set to #value.

Where in the macro i created would i add the code you gave me? Thanks
again
for your help.


"Tom Ogilvy" wrote:

if you want do delete rows with a blank value in column 2

sub DeleteRows()
on Error Resume Next
columns(2).specialCells(xlBlanks).EntireRow.delete
On Error goto 0
End sub

--
Regards,
Tom Ogilvy


"Marilyn" wrote:

I'm trying to create a loop macro that will delete a row based on
its value,
but somehow is not working. I'm not an expert in macros so can
anyone point
me in the right direction?

Please HELP!

Sub rowdeletion()

' rowdeletion Macro

x = ActiveCell.Row

Do While Cells(x, 2).Value < "" (I keep getting a type missmatch
error on
this line)



'If (Columns("B:B").Select < "#VALUE!") Then

' Rows("1:1").Select

' Selection.Delete Shift:=xlUp

' End If



x = x + 1

Loop

End Sub


Thanks



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
Macro that isn't working Brad Excel Discussion (Misc queries) 2 October 29th 09 08:23 PM
macro was working, now it's not working RichardO[_11_] Excel Programming 2 June 9th 04 06:27 AM
Macro working in Excel 2003; not working in Excel 2000 Leslie Barberie Excel Programming 5 May 20th 04 07:51 PM
Working on a macro Bob[_52_] Excel Programming 1 April 29th 04 07:04 AM
Don't want to SEE macro working Randall \(again...\) Excel Programming 2 February 23rd 04 03:20 PM


All times are GMT +1. The time now is 03:18 PM.

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"