Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Manipulating Data in a row

Hello,

How do I change data in a column via VBA. Here's what I am referring to: In
column A I have data that looks like this
0001
0002
0003

I need to take off the leading 0 so it looks like this:
001
002
003

Any help would be appreciated !

Developer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Manipulating Data in a row

one way.

Sub takezero()

Dim cell As Range
For Each cell In Range("A1:A100")
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
Next cell



End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Manipulating Data in a row

for each cell in selection
cell.Value = "'" & Right(cell.Text,3)
Next

This assumes the zeros are not produced using a custom format.
If that is the case, just change the custom format.

--
Regards,
Tom Ogilvy


"Gsurfdude" wrote in message
...
Hello,

How do I change data in a column via VBA. Here's what I am referring to:

In
column A I have data that looks like this
0001
0002
0003

I need to take off the leading 0 so it looks like this:
001
002
003

Any help would be appreciated !

Developer



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Manipulating Data in a row

Tom:

Thanks. This worked fine and what was needed..

Thanx again

"Tom Ogilvy" wrote:

for each cell in selection
cell.Value = "'" & Right(cell.Text,3)
Next

This assumes the zeros are not produced using a custom format.
If that is the case, just change the custom format.

--
Regards,
Tom Ogilvy


"Gsurfdude" wrote in message
...
Hello,

How do I change data in a column via VBA. Here's what I am referring to:

In
column A I have data that looks like this
0001
0002
0003

I need to take off the leading 0 so it looks like this:
001
002
003

Any help would be appreciated !

Developer




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
Help With Manipulating Data Pat Excel Discussion (Misc queries) 3 November 21st 08 01:41 PM
Help with manipulating data in excel? jock Excel Discussion (Misc queries) 3 July 29th 08 03:24 PM
Manipulating a matrix of data Magenta Excel Discussion (Misc queries) 3 February 5th 08 05:48 AM
manipulating scanned data alaskachic Excel Discussion (Misc queries) 2 November 17th 06 09:13 PM
Manipulating Data Problem Jeff Excel Worksheet Functions 0 June 8th 06 04:28 AM


All times are GMT +1. The time now is 03:59 AM.

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"