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 11 May 2002, 08:07 AM
  #1  
velohead66
Scooby Regular
Thread Starter
 
velohead66's Avatar
 
Join Date: Oct 2002
Location: ex UK [SE], now Sunshine State [QLD,AUS]
Posts: 565
Likes: 0
Received 1 Like on 1 Post
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]
Old 05 November 2002, 05:43 AM
  #2  
velohead66
Scooby Regular
Thread Starter
 
velohead66's Avatar
 
Join Date: Oct 2002
Location: ex UK [SE], now Sunshine State [QLD,AUS]
Posts: 565
Likes: 0
Received 1 Like on 1 Post
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
Old 05 November 2002, 08:01 AM
  #3  
Martingb
Scooby Regular
 
Martingb's Avatar
 
Join Date: Oct 2001
Posts: 65
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 05 November 2002, 08:03 AM
  #4  
velohead66
Scooby Regular
Thread Starter
 
velohead66's Avatar
 
Join Date: Oct 2002
Location: ex UK [SE], now Sunshine State [QLD,AUS]
Posts: 565
Likes: 0
Received 1 Like on 1 Post
Cool

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



Quick Reply: Visual Basic For EXCEL question



All times are GMT +1. The time now is 09:38 AM.