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 to subtract data from cells


I need a macro to take away data from my spreadsheet. The spreadsheet i
created from data i have emailed to me from a form on my website.

For example, each set of cells would have something like this with eac
line in each cell

F_name: John Smith
Unit: Computer Tech
Comments: blah blah blah

I would like the macro to take away the "F_name:, Unit:, and Comments:
text leaving only the valuable information that i can then make a goo
informative sheet with.

I am an experienced excel user so if you have any ideas please let m
know.

Thank

--
s_tyron
-----------------------------------------------------------------------
s_tyrone's Profile: http://www.excelforum.com/member.php...fo&userid=2751
View this thread: http://www.excelforum.com/showthread.php?threadid=47021

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Macro to subtract data from cells

I think that a piece of code which traverses each row of your spreadsheet and
checks the beginning of each cell's value against your standard values will
do what you need.

i.e.
(A column is an index, B column is the name field and so on)
line_counter=1
While line_counter < range("blah").rows.count

Activecell.Offset(1,0).Select // move down one row in A column

if Left(Activecell.Offset(0,1).Value,12)="Your name : " then
Activecell.Offset(0,1).Value=MID(Activecell.Offset (0,1).Value,13,999) //
this leaves the remaining characters after the unwanted part in the B column
cell
endif

line_counter=line_counter+1

Wend

Hope this helps
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
HOW CAN ADD AND SUBTRACT WITH THE SEQUENCE OF CELLS japram Excel Discussion (Misc queries) 6 March 1st 09 10:28 PM
How do I add a column of cells, but IF a row has (), subtract? Brandy Excel Worksheet Functions 4 April 4th 06 04:59 PM
subtract 3 numbers and 2 cells lmassier New Users to Excel 1 March 27th 06 04:53 PM
How can I subtract cells in a row wildfyre New Users to Excel 3 February 14th 06 07:26 PM
how to add or subtract from two cells into one labjr1231 Excel Worksheet Functions 2 September 6th 05 06:40 AM


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