Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Excel Questions

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:05 - 17 Jan 2013    Post subject: Excel Questions Reply with quote

I have a file that has the following layout.

case "875":
significand = 6;
break;
case "876":
significand = 5;
break;
case "873":
significand = 4;
break;
case "626":
significand = 8;
break;

I want to put the data one one line.

case "875": significand = 6; break;
case "876": significand = 5; break;

Obviously the break is not required. Anyone know an easy way to sort this in Excel or otherwise?
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

cimbian
World Chat Champion



Joined: 27 Sep 2012
Karma :

PostPosted: 15:11 - 17 Jan 2013    Post subject: Reply with quote

use concatenate and then copy/paste 'values'.

https://i1029.photobucket.com/albums/y360/Cimbian/Fun-stuff/Capture_zps4e869a8b.jpg
____________________
22PlusY
Current: Moto Guzzi 1100 Breva. Previous: Honda XL650V TransAlp
Bearded, Balding, Born again Buddhist Biker
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 16:12 - 17 Jan 2013    Post subject: Reply with quote

The file is like 2000 records long that would take ages however it gave me a good idea,

Concatenate then copy all the way down. Number the records 1,2,3,1,2,3 all the way down then pull out the 1's Thumbs Up
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

cimbian
World Chat Champion



Joined: 27 Sep 2012
Karma :

PostPosted: 17:30 - 17 Jan 2013    Post subject: Reply with quote

You're welcome.
____________________
22PlusY
Current: Moto Guzzi 1100 Breva. Previous: Honda XL650V TransAlp
Bearded, Balding, Born again Buddhist Biker
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

Aff
World Chat Champion



Joined: 05 May 2011
Karma :

PostPosted: 21:35 - 17 Jan 2013    Post subject: Reply with quote

Haven't written macros for ages so hope this works, give it a go:

Code:
Sub MoveAndDelete()
    Dim Sentences
    Dim i As Long
    Dim iWordPos As Integer
    Sentences = Range("A1", Range("A65536").End(xlUp))
    lRow = 0
    For i = Range("A65536").End(xlUp).Row To 1 Step -1
        iWordPos = InStr(LCase(Sentences(i, 1)), LCase("break;"))
        If iWordPos > 0 Then
            Range("A" & i).EntireRow.Delete shift:=xlShiftUp
        End If
    Next i
    For i = Range("A65536").End(xlUp).Row To 2 Step -2
    Cells(i - 1, 2).Value = Cells(i, 1).Value
    Cells(i, 1).EntireRow.Delete
    Next i
End Sub


HTH Thumbs Up
____________________
Current Bikes:Honda 929RR Fireblade, Honda CD200 Benly (Project), Stomp Z2 140
Electric Bike Project
 Back to top
View user's profile Send private message You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 21:49 - 17 Jan 2013    Post subject: Reply with quote

Is there any relationship between the case and significand values? A 2000 line case statement seems very inefficient - any chance of sticking them in a lookup table instead?
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 13 years, 258 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot 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
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.22 Sec - Server Load: 0.97 - MySQL Queries: 13 - Page Size: 50.21 Kb