Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro or IF statement??? HELP!

Hi - I've got a stack of customer data that's been
extracted from a database in CSV format and then opened in
Excel

All's well apart from some of the accounts I dont need -
these are one's that have no deatils in the "Bank" "Sort
Code" "Account" columns.

My question is how do I go about getting Excel to look at
the blanks and automatically Delete them?

So far my little knowledge allowed me to make the
following if statement but it only tells me to
physically "DELETE" non-bank customers... I want to know
how I get to tell Excel to actually search for bloanks
then delete.... if that makes sence!!

HELP
Ta
Julia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Macro or IF statement??? HELP!

VBA (Macro) is the way to go but more details on your spreadsheets layout will be required if you want assistance with code. In the mean time, Record a macro to execute some of the events you want to accomplish and take a look at the code asociated with it so u have an idea of how it looks and works.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro or IF statement??? HELP!

Hi Julia,

You can do this manually:

F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

If you need a programming solution, try:

Sub DelNoSortCodes()
Dim Rng As Range

Set Rng = Range("B2:B1000") ' <-- Adjust to your
SortCode Range

On Error Resume Next
Rng.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

---
regards,
Norman


"Julia Easter" wrote in message
...
Hi - I've got a stack of customer data that's been
extracted from a database in CSV format and then opened in
Excel

All's well apart from some of the accounts I dont need -
these are one's that have no deatils in the "Bank" "Sort
Code" "Account" columns.

My question is how do I go about getting Excel to look at
the blanks and automatically Delete them?

So far my little knowledge allowed me to make the
following if statement but it only tells me to
physically "DELETE" non-bank customers... I want to know
how I get to tell Excel to actually search for bloanks
then delete.... if that makes sence!!

HELP
Ta
Julia



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Macro or IF statement??? HELP!

This is a wholesale approach: if your just looking for any blank cell, but if you have intermittent blank cells within your range, but are still part of a valid account record they will be deleted too. So be cautious how you use this. If you need to have a set of criteria before you delete a row more sophisticated code is required
----- Norman Jones wrote: ----

Hi Julia

You can do this manually

F5 key | Special | Blanks | o
Edit | Delete | Entire Row | o

If you need a programming solution, try

Sub DelNoSortCodes(
Dim Rng As Rang

Set Rng = Range("B2:B1000") ' <-- Adjust to you
SortCode Rang

On Error Resume Nex
Rng.SpecialCells(xlBlanks).EntireRow.Delet
On Error GoTo
End Su

--
regards
Norma


"Julia Easter" wrote in messag
..
Hi - I've got a stack of customer data that's bee
extracted from a database in CSV format and then opened i
Exce
All's well apart from some of the accounts I dont need

these are one's that have no deatils in the "Bank" "Sor
Code" "Account" columns
My question is how do I go about getting Excel to look a

the blanks and automatically Delete them
So far my little knowledge allowed me to make th

following if statement but it only tells me t
physically "DELETE" non-bank customers... I want to kno
how I get to tell Excel to actually search for bloank
then delete.... if that makes sence!
HEL

T
Juli




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro or IF statement??? HELP!

Hi Chris,

Julia said:

"All's well apart from some of the accounts I dont need -
these are one's that have no deatils in the "Bank" "Sort"

I stand by my post.

---
Regards,
Norman

"chris" wrote in message
...
This is a wholesale approach: if your just looking for any blank cell,

but if you have intermittent blank cells within your range, but are still
part of a valid account record they will be deleted too. So be cautious how
you use this. If you need to have a set of criteria before you delete a row
more sophisticated code is required.
----- Norman Jones wrote: -----

Hi Julia,

You can do this manually:

F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

If you need a programming solution, try:

Sub DelNoSortCodes()
Dim Rng As Range

Set Rng = Range("B2:B1000") ' <-- Adjust to your
SortCode Range

On Error Resume Next
Rng.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

---
regards,
Norman


"Julia Easter" wrote in message
...
Hi - I've got a stack of customer data that's been
extracted from a database in CSV format and then opened in
Excel
All's well apart from some of the accounts I dont need -

these are one's that have no deatils in the "Bank" "Sort
Code" "Account" columns.
My question is how do I go about getting Excel to look at

the blanks and automatically Delete them?
So far my little knowledge allowed me to make the

following if statement but it only tells me to
physically "DELETE" non-bank customers... I want to know
how I get to tell Excel to actually search for bloanks
then delete.... if that makes sence!!
HELP

Ta
Julia








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Macro or IF statement??? HELP!

Actually she said: "these are one's that have no deatils in the "Bank" "Sor
Code" "Account" columns."
Which means that those 3 columns are blank, but there could possibly be other columns., also your not sure if a record may have data in one and not in another but yet still be valid. OPs don't always give the full picture so i'm not quick to give them quick easy solutions that could wipe out their data


----- Norman Jones wrote: ----

Hi Chris

Julia said

"All's well apart from some of the accounts I dont need
these are one's that have no deatils in the "Bank" "Sort

I stand by my post

--
Regards
Norma

"chris" wrote in messag
..
This is a wholesale approach: if your just looking for any blank cell

but if you have intermittent blank cells within your range, but are stil
part of a valid account record they will be deleted too. So be cautious ho
you use this. If you need to have a set of criteria before you delete a ro
more sophisticated code is required
----- Norman Jones wrote: ----
Hi Julia
You can do this manually
F5 key | Special | Blanks | o

Edit | Delete | Entire Row | o
If you need a programming solution, try
Sub DelNoSortCodes(

Dim Rng As Rang
Set Rng = Range("B2:B1000") ' <-- Adjust to you

SortCode Rang
On Error Resume Nex

Rng.SpecialCells(xlBlanks).EntireRow.Delet
On Error GoTo
End Su
--

regards
Norma
"Julia Easter" wrote in messag

..
Hi - I've got a stack of customer data that's bee
extracted from a database in CSV format and then opened i
Exce
All's well apart from some of the accounts I dont need

these are one's that have no deatils in the "Bank" "Sor
Code" "Account" columns
My question is how do I go about getting Excel to look a

the blanks and automatically Delete them
So far my little knowledge allowed me to make th

following if statement but it only tells me t
physically "DELETE" non-bank customers... I want to kno
how I get to tell Excel to actually search for bloank
then delete.... if that makes sence!
HEL

T
Juli

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro or IF statement??? HELP!

Hi Chris,

Re-reading my response to Julia, I see that my manual solution omitted the
necessary first line:

Select the Sort Code Range

as shown explicitly in the VBA solution.

My apologies.

---
Regards
Norman

"chris" wrote in message
...
This is a wholesale approach: if your just looking for any blank cell,

but if you have intermittent blank cells within your range, but are still
part of a valid account record they will be deleted too. So be cautious how
you use this. If you need to have a set of criteria before you delete a row
more sophisticated code is required.
----- Norman Jones wrote: -----

Hi Julia,

You can do this manually:

F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

If you need a programming solution, try:

Sub DelNoSortCodes()
Dim Rng As Range

Set Rng = Range("B2:B1000") ' <-- Adjust to your
SortCode Range

On Error Resume Next
Rng.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

---
regards,
Norman


"Julia Easter" wrote in message
...
Hi - I've got a stack of customer data that's been
extracted from a database in CSV format and then opened in
Excel
All's well apart from some of the accounts I dont need -

these are one's that have no deatils in the "Bank" "Sort
Code" "Account" columns.
My question is how do I go about getting Excel to look at

the blanks and automatically Delete them?
So far my little knowledge allowed me to make the

following if statement but it only tells me to
physically "DELETE" non-bank customers... I want to know
how I get to tell Excel to actually search for bloanks
then delete.... if that makes sence!!
HELP

Ta
Julia






  #8   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro or IF statement??? HELP!

Thanks for all the help - have it sussed now. Spreadsheet
working beautifully!!

Cheers for that!
Julia
-----Original Message-----
Hi Chris,

Re-reading my response to Julia, I see that my manual

solution omitted the
necessary first line:

Select the Sort Code Range

as shown explicitly in the VBA solution.

My apologies.

---
Regards
Norman

"chris" wrote in

message
...
This is a wholesale approach: if your just looking for

any blank cell,
but if you have intermittent blank cells within your

range, but are still
part of a valid account record they will be deleted too.

So be cautious how
you use this. If you need to have a set of criteria

before you delete a row
more sophisticated code is required.
----- Norman Jones wrote: -----

Hi Julia,

You can do this manually:

F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

If you need a programming solution, try:

Sub DelNoSortCodes()
Dim Rng As Range

Set Rng = Range("B2:B1000") ' <-- Adjust to

your
SortCode

Range

On Error Resume Next
Rng.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

---
regards,
Norman


"Julia Easter" wrote in

message
...
Hi - I've got a stack of customer data that's

been
extracted from a database in CSV format and then

opened in
Excel
All's well apart from some of the accounts I

dont need -
these are one's that have no deatils in

the "Bank" "Sort
Code" "Account" columns.
My question is how do I go about getting Excel

to look at
the blanks and automatically Delete them?
So far my little knowledge allowed me to make

the
following if statement but it only tells me to
physically "DELETE" non-bank customers... I want

to know
how I get to tell Excel to actually search for

bloanks
then delete.... if that makes sence!!
HELP
Ta
Julia






.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro or IF statement??? HELP!

Hi Julia,

For the manual solution, you need to initially select the Sort Code range
and therefore the manual instructions should read:

Select your Sort Code range
F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi Julia,

You can do this manually:

F5 key | Special | Blanks | ok
Edit | Delete | Entire Row | ok

If you need a programming solution, try:

Sub DelNoSortCodes()
Dim Rng As Range

Set Rng = Range("B2:B1000") ' <-- Adjust to your
SortCode Range

On Error Resume Next
Rng.SpecialCells(xlBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

---
regards,
Norman


"Julia Easter" wrote in message
...
Hi - I've got a stack of customer data that's been
extracted from a database in CSV format and then opened in
Excel

All's well apart from some of the accounts I dont need -
these are one's that have no deatils in the "Bank" "Sort
Code" "Account" columns.

My question is how do I go about getting Excel to look at
the blanks and automatically Delete them?

So far my little knowledge allowed me to make the
following if statement but it only tells me to
physically "DELETE" non-bank customers... I want to know
how I get to tell Excel to actually search for bloanks
then delete.... if that makes sence!!

HELP
Ta
Julia





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 to If Statement JHusker Excel Discussion (Misc queries) 7 October 10th 08 10:39 PM
If statement in macro punter Excel Discussion (Misc queries) 3 June 20th 06 12:23 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
IF statement macro Qwerty Excel Programming 1 January 11th 04 09:22 PM
Macro statement Sheela Excel Programming 1 September 2nd 03 10:17 AM


All times are GMT +1. The time now is 03:01 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"