Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
bhola-bhala
 
Posts: n/a
Default Editing fields in bulk


I am trying to remove all extra rows between some text.. lets say:

XXXXX
-------
-------
YYYYY


I am trying to remove all ------ part like i want to keep row #1 & #3
but i want to remove row #2, ,how can i do that? And i am not talking
about 1 row, there are more than 10,000 records :)


--
bhola-bhala
------------------------------------------------------------------------
bhola-bhala's Profile: http://www.excelforum.com/member.php...o&userid=33066
View this thread: http://www.excelforum.com/showthread...hreadid=528804

  #2   Report Post  
Posted to microsoft.public.excel.misc
Door
 
Posts: n/a
Default Editing fields in bulk


Your question is not easy to reply.

Do you want to know the vba code for this to happen on a Button or
Macro, or do you want to (manually) Sort the rows and bulk-delete all
----- lines, then re-sort into original sequence?
(ie, insert a column and sequence number = row - copy that column and
Paste Special = Values back over itsself, insert a further column and
test for XXXXX and YYYYY and note all others as 'del', sort over this
second column, delete all 'del' lines, re-sort over the first inserted
column and delete the two worker columns)

Are the ----- lines truly ----- or are they other (undefined) data.
What is the true definition of XXXXX lines and YYYYY lines?

Any further clues?


bhola-bhala Wrote:
I am trying to remove all extra rows between some text.. lets say:

XXXXX
-------
-------
YYYYY


I am trying to remove all ------ part like i want to keep row #1 & #3
but i want to remove row #2, ,how can i do that? And i am not talking
about 1 row, there are more than 10,000 records :)



--
Door
------------------------------------------------------------------------
Door's Profile: http://www.excelforum.com/member.php...o&userid=33068
View this thread: http://www.excelforum.com/showthread...hreadid=528804

  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Editing fields in bulk

I've tested this code and it appeared to run ok, but save a copy of your
original worksheet before implenting the code just to be on the safe side.
It ain't pretty but it got the job done.

Sub RemoveRows()

Dim wb As Workbook
Dim ws As Worksheet
Dim lngRow As Long
Dim varVal As Variant

Set wb = ActiveWorkbook
Set ws = wb.Worksheets("Sheet1")

'Activate sheet 1 of the current workbook and
'select cell A1
ws.Activate
Range("A1").Select

'Suppress screen updating
Application.ScreenUpdating = False

'exit loop if row counter exceeds the maximum
'amount of rows
Do Until lngRow = 65537
'Get the value of the current cell
'and increment the row couner
varVal = ActiveCell.Value
lngRow = lngRow + 1
'Display what row is being processed on
'the status bar
Application.StatusBar = "Processing row " & _
Format$(CStr(lngRow), "#,###")
If varVal = "" Then
'if the current cells value is empty
'then delete the row, increment the
'row counter get the next value to
'evaluate and refresh the status bar
'message
Do Until varVal < ""
If varVal = "" Then
Selection.EntireRow.Delete
varVal = ActiveCell.Value
lngRow = lngRow + 1
If lngRow = 65537 Then Exit Do
Application.StatusBar = _
"Processing row " & _
Format$(CStr(lngRow), "#,###")
End If
Loop
End If
'Once all blank rows have been removed between
'one data set and the next, select the next cell
'and loop
ActiveCell.Offset(1).Select
Loop

Set ws = Nothing
Set wb = Nothing
Application.StatusBar = False
Application.ScreenUpdating = True
Exit Sub

End Sub
--
Kevin Backmann


"bhola-bhala" wrote:


I am trying to remove all extra rows between some text.. lets say:

XXXXX
-------
-------
YYYYY


I am trying to remove all ------ part like i want to keep row #1 & #3
but i want to remove row #2, ,how can i do that? And i am not talking
about 1 row, there are more than 10,000 records :)


--
bhola-bhala
------------------------------------------------------------------------
bhola-bhala's Profile: http://www.excelforum.com/member.php...o&userid=33066
View this thread: http://www.excelforum.com/showthread...hreadid=528804


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
Calculated Field in Pivot Table Based on Two Counted Fields cmlits Excel Discussion (Misc queries) 1 March 30th 06 05:44 AM
How do I lock some fields but allow editing for others in excel S.Sharif Excel Discussion (Misc queries) 1 December 13th 05 02:58 AM
Need pie chart with number of fields instead of info in fields Lloyd Pratt Charts and Charting in Excel 1 September 21st 05 11:56 PM
Number of dropdown fields in Excel is limited. I need more. How? UweVahrson Excel Discussion (Misc queries) 7 March 28th 05 05:10 PM
Sorting Spreadsheet with Merged Fields Linda L Excel Discussion (Misc queries) 1 January 22nd 05 12:58 AM


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