Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA / Data Sorting / Maniputaltion

i have a long list, which i imported from other data base.
The problem is:
1. In each cell, besides data (data is in alphabates) there are som
numeric characters which i dont want .
How can i get rid of all those unwanted numbers from data, from all th
list?

2. The data is in every second row, ie. one row is empty.
How can i Delete those empty/blank rows from the list

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel VBA / Data Sorting / Maniputaltion

Abdul

Here is a quick solution it works on the selction.

Sub removeNums()
Dim c, p
Dim l As Integer, i As Integer
For Each c In Selection
l = Len(c)
For i = l To 1 Step -1
p = Mid(c, i, 1)
If Asc(p) 47 And Asc(p) < 58 Then
c.Value = Left(c, Len(c) - 1)
Else: c = Trim(c)
End If
Next i
Next c
End Sub


Regards
Peter
-----Original Message-----
i have a long list, which i imported from other data base.
The problem is:
1. In each cell, besides data (data is in alphabates)

there are some
numeric characters which i dont want .
How can i get rid of all those unwanted numbers from

data, from all the
list?

2. The data is in every second row, ie. one row is empty.
How can i Delete those empty/blank rows from the list?


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA / Data Sorting / Maniputaltion

Removing empty row can be done with

Sub removeRows()
Dim i As Long, nr As Long
nr = Application.WorksheetFunction.CountA(Range("A:A"))
For i = nr To 1 Step -1
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1).EntireRow.Delete
End If
Next i

End Sub

Regards
Peter
-----Original Message-----
i have a long list, which i imported from other data base.
The problem is:
1. In each cell, besides data (data is in alphabates)

there are some
numeric characters which i dont want .
How can i get rid of all those unwanted numbers from

data, from all the
list?

2. The data is in every second row, ie. one row is empty.
How can i Delete those empty/blank rows from the list?


---
Message posted from http://www.ExcelForum.com/

.

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
Excel Data Sorting Cheryl Excel Worksheet Functions 4 October 8th 08 08:51 PM
Excel Data sorting Muddled Excel Discussion (Misc queries) 0 May 22nd 07 01:57 AM
Sorting data in excel Muddled Excel Worksheet Functions 1 May 20th 07 05:23 AM
Sorting Excel Data artlawton New Users to Excel 2 June 8th 05 04:37 PM
Sorting data in Excel.. dan1001 Excel Worksheet Functions 1 March 1st 05 05:08 PM


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