WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Deleting first character issue

 
   Home -> Office -> New Users RSS
Next:  Copying a named range with a changing cell refere..  
Author Message
saman110 via OfficeKB.com

External


Since: Jul 23, 2007
Posts: 52



(Msg. 1) Posted: Thu Feb 21, 2008 12:27 am
Post subject: Deleting first character issue
Archived from groups: microsoft>public>excel>newusers (more info?)

This macro deletes first character of each cell in a range. But if there is
black cell in the begining or in between cells it does not work.
Is there any way to overcome this issue.

thx.

Sub RemoveQuote()
On Error GoTo e
Dim rng As Range, cell As Object
Set rng = Selection
For Each cell In rng
cell = Right(cell, Len(cell) - 1)

Next cell
e:
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-new/200802/1
Back to top
Login to vote
Jim Cone

External


Since: Dec 11, 2003
Posts: 429



(Msg. 2) Posted: Thu Feb 21, 2008 12:27 am
Post subject: Re: Deleting first character issue [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sub RemoveQuote_R1()
On Error GoTo e
Dim rng As Range, cell As Range
Set rng = Selection
For Each cell In rng.Cells
If cell.HasFormula = False Then
If Len(cell.PrefixCharacter) > 0 Then
cell.Value = cell.Value
ElseIf Len(cell.Value) > 0 Then
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
End If
End If
Next 'cell
e:
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"saman110 via OfficeKB.com"
wrote in message
This macro deletes first character of each cell in a range. But if there is
black cell in the begining or in between cells it does not work.
Is there any way to overcome this issue.
thx.

Sub RemoveQuote()
On Error GoTo e
Dim rng As Range, cell As Object
Set rng = Selection
For Each cell In rng
cell = Right(cell, Len(cell) - 1)
Next cell
e:
End Sub
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> New Users All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support