Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Visual Basic For EXCEL question

Thread Tools
 
Search this Thread
 
Old May 11, 2002 | 08:07 AM
  #1  
velohead66's Avatar
velohead66
Thread Starter
Scooby Regular
 
Joined: Oct 2002
Posts: 565
Likes: 1
From: ex UK [SE], now Sunshine State [QLD,AUS]
Post

dont suppose you know the answer to this one as well ??

different vb question

[Edited by velohead66 - 11/5/2002 8:12:13 AM]
Reply
Old Nov 5, 2002 | 05:43 AM
  #2  
velohead66's Avatar
velohead66
Thread Starter
Scooby Regular
 
Joined: Oct 2002
Posts: 565
Likes: 1
From: ex UK [SE], now Sunshine State [QLD,AUS]
Question

Say you have a variable called x that is different length of characters each time a next loop is run.
In VB how do you delete the last character.
eg change "20.00-" to "20.00"
and then change "20000.00z" to "20000.00"
on the next loop ????

NB1 Loop might run up to 1,000 times, as it passes down a column of figures
NB2 Character to be deleted will be a different character each time, but always in the same place.

PS-I could use excel functions mid.right,left etc, but I want the VB script please.

Ta
Reply
Old Nov 5, 2002 | 08:01 AM
  #3  
Martingb's Avatar
Martingb
Scooby Regular
 
Joined: Oct 2001
Posts: 65
Likes: 0
Post

If you assign the result to a variable Y then:

y=left(x,len(x)-1))

Here, you are taking the length of the string minus one, and using this to return the left part of your string.

Hope that helps,

Martin.
Reply
Old Nov 5, 2002 | 08:03 AM
  #4  
velohead66's Avatar
velohead66
Thread Starter
Scooby Regular
 
Joined: Oct 2002
Posts: 565
Likes: 1
From: ex UK [SE], now Sunshine State [QLD,AUS]
Cool

Sounds good, I'll try at work tomorrow. Ta.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
Dec 28, 2015 11:07 PM
Frizzle-Dee
Essex Subaru Owners Club
13
Dec 1, 2015 09:37 AM
PetrolHeadKid
Driving Dynamics
10
Oct 5, 2015 05:19 PM
bluebullet29
General Technical
9
Oct 5, 2015 02:17 PM
Pro-Line Motorsport
Car Parts For Sale
2
Sep 29, 2015 07:36 PM




All times are GMT +1. The time now is 03:30 PM.