VBA Help

Discussion in 'OT Technology' started by poisonivvy, Feb 22, 2005.

  1. poisonivvy

    poisonivvy New Member

    Joined:
    Aug 8, 2003
    Messages:
    1,446
    Likes Received:
    0
    Location:
    Washington State
    I'm doing a program/macro thing for work. I'm having the worst time with it though. The main thing I need to know (and yes, I have googled and looked at other search engines) is to dump data from one column into a variable.

    So far I have:

    Dim strClass As String
    Dim strBook As String
    Dim strEdition As String
    Dim strISBN As String
    Dim strPref As String
    Dim wholeline As String


    Dim i As Integer


    For i = 1 To Selection.CurrentRegion.Rows.Count - 1

    Do While Not IsEmpty(ActiveCell)


    strName = ActiveCell

    ActiveCell.Offset(1, 0).Select

    Next i




    But I can't figure out how to make the Data go into the variable so that I can write it out.

    My data looks like:
    AA200 Hyde- Global S05 0615154 Required
    AA260 Global Issues S06 141883063 Required

    BA210 Global Issues S08 254544524
    BA220 Global Issues S09 241157
    BA640 Global Issues S10 453877654

    FD300 Global Issues S12 456874
    Thanks in advance. :p
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Is this in Excel? Cuz I think there's some better ways to do this depending on what the output is supposed to be.
     
  3. poisonivvy

    poisonivvy New Member

    Joined:
    Aug 8, 2003
    Messages:
    1,446
    Likes Received:
    0
    Location:
    Washington State
    Yah, in Excel. I have imported a txt file into there.
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    So what is the output supposed to be with the dataset you supplied (I'm assuming you import each record into a new row and each field into it's own column)
     
  5. poisonivvy

    poisonivvy New Member

    Joined:
    Aug 8, 2003
    Messages:
    1,446
    Likes Received:
    0
    Location:
    Washington State
    The output is simply going into another tab on the bottom of the worksheet file. For example, the AA's will go into one tab (new worksheet) then the BA's will go into another tab..until I get to the end of file. Any ideas?
     
  6. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Hmmm - no I don't actually. Sounds like a lot of worksheets. I could do it in access but not Excel.
     
  7. poisonivvy

    poisonivvy New Member

    Joined:
    Aug 8, 2003
    Messages:
    1,446
    Likes Received:
    0
    Location:
    Washington State
    Hmm that's a good thought. Take it into Access through txt file, do some querying on it to separate. That might work. Thanks!
     

Share This Page