Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default find last row, copy until end

Hi Folks,

I have data that is pasted into column "A" from a macro. The macro first
deletes all data from the sheet ("Totals"), then runs a db query on another
sheet ("Receives"), subtotals, then copies the subtotals back to the original
sheet ("Totals"). that rage will always be dynamic and contain a differing
number of rows, but will always contain the word 'Total' at the end of each
value in column "A".

I would like the macro, once the new values are copied, to find the last
row, and remove the last 6 characters from each value in column "A".

I'm stuck on the finding last row, then looping through non empty rows and
trimming the string...

customer 1 Total -should become-
customer 1
customer name 2 Total -should become-
customer name 2

....and so on. Each value in column "A" will be of a variable length, and
removing the word 'Total' and the preceding space will solve my problem.

TIA!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default find last row, copy until end

Stephen what about using the Replace method on column A and replacing "
Total" with ""?

Range("A:A").Replace What:=" Total", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False


--
Charles Chickering

"A good example is twice the value of good advice."


"Stephen" wrote:

Hi Folks,

I have data that is pasted into column "A" from a macro. The macro first
deletes all data from the sheet ("Totals"), then runs a db query on another
sheet ("Receives"), subtotals, then copies the subtotals back to the original
sheet ("Totals"). that rage will always be dynamic and contain a differing
number of rows, but will always contain the word 'Total' at the end of each
value in column "A".

I would like the macro, once the new values are copied, to find the last
row, and remove the last 6 characters from each value in column "A".

I'm stuck on the finding last row, then looping through non empty rows and
trimming the string...

customer 1 Total -should become-
customer 1
customer name 2 Total -should become-
customer name 2

...and so on. Each value in column "A" will be of a variable length, and
removing the word 'Total' and the preceding space will solve my problem.

TIA!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default find last row, copy until end

THAT'S FANTASTIC!!!!!

Thank you very much!

"Charles Chickering" wrote:

Stephen what about using the Replace method on column A and replacing "
Total" with ""?

Range("A:A").Replace What:=" Total", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False


--
Charles Chickering

"A good example is twice the value of good advice."


"Stephen" wrote:

Hi Folks,

I have data that is pasted into column "A" from a macro. The macro first
deletes all data from the sheet ("Totals"), then runs a db query on another
sheet ("Receives"), subtotals, then copies the subtotals back to the original
sheet ("Totals"). that rage will always be dynamic and contain a differing
number of rows, but will always contain the word 'Total' at the end of each
value in column "A".

I would like the macro, once the new values are copied, to find the last
row, and remove the last 6 characters from each value in column "A".

I'm stuck on the finding last row, then looping through non empty rows and
trimming the string...

customer 1 Total -should become-
customer 1
customer name 2 Total -should become-
customer name 2

...and so on. Each value in column "A" will be of a variable length, and
removing the word 'Total' and the preceding space will solve my problem.

TIA!

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
Copy contents of Find (Find and Replace) rob_bob Excel Discussion (Misc queries) 0 March 26th 09 11:01 PM
Find in XML and Copy S1L1Y1 Excel Discussion (Misc queries) 0 May 19th 08 05:50 PM
Find and Copy QPapillon Excel Discussion (Misc queries) 4 September 25th 06 10:09 PM
Find and Copy Fred[_27_] Excel Programming 2 January 17th 06 12:36 PM
find and copy Lost Excel Worksheet Functions 1 October 1st 05 06:15 PM


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