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 trim function maybe?

I need to search the spreadsheet/table to find the first blank row " " -
Column A or the words "Elimination Totals". The function should delete that
row and all the rows below it. Note - each spreadsheet has elimination
totals on different rows however they are located under column C on all the
spreadsheets.

Please note that this file will be later imported to access. and also later
the macro/vba code/or functions might be cut out of excel and used into
access too.

--
Tech Learner
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Excel trim function maybe?

Try this code.

Sub delrows()

lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set colARange = Range("A1:A" & lastrow)
Set c = colARange.Find(what:="Elimination Totals", _
LookIn:=xlValues)
If c Is Nothing Then
Rows("1:" & lastrow).Delete
Else
Rows("1:" & c.Row).Delete
End If


End Sub

"Nakli" wrote:

I need to search the spreadsheet/table to find the first blank row " " -
Column A or the words "Elimination Totals". The function should delete that
row and all the rows below it. Note - each spreadsheet has elimination
totals on different rows however they are located under column C on all the
spreadsheets.

Please note that this file will be later imported to access. and also later
the macro/vba code/or functions might be cut out of excel and used into
access too.

--
Tech Learner

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
Trim function to remove blank spaces in Excel Natty Excel Discussion (Misc queries) 1 June 26th 08 03:31 PM
Trim Function Steved Excel Worksheet Functions 5 August 4th 05 11:06 PM
Problem with TRIM function in Excel Julie Beth Excel Programming 4 June 17th 05 05:32 PM
Trim function in VBA molavi111 Excel Programming 3 September 22nd 04 05:59 PM
Trim function in Excel Doesn't work for certain cells Neeraja Excel Programming 1 October 14th 03 09:12 AM


All times are GMT +1. The time now is 06:52 PM.

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

About Us

"It's about Microsoft Excel"