+ Reply to Thread
Results 1 to 14 of 14

Pulling data from a charging file!

Hybrid View

  1. #1
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    I am not sure about the .csv file because I am relatively new to programming myself, but here is code that I think will work for your first issue:

    Range("B1").Select
    Dim UniqueID As String
    Dim RowNum As Integer
    UniqueID = SomeNumber
    RowNum = 1
    Do Until ActiveCell = ""
    If ActiveCell = UniqueID Then
    Rows(RowNum).Select
    Selection.Copy
    Sheets("Sheet2").Select
    ActiveSheet.Paste
    End
    Else
    ActiveCell.Offset(1, 0).Select
    RowNum = RowNum + 1
    End If
    Loop
    I went on some assumptions 1) The sheet to copy to is called "Sheet2" 2) The ID number could be anything.

    Hope this helps!

  2. #2
    Registered User
    Join Date
    09-28-2007
    Posts
    7
    Thank you very much! It does great at finding the cell, but it does not select the row? I have tried a few things now, but it does not want to select and copy the row. But that is a major step solved, again thank you very much!

    Andrew

  3. #3
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    It was working for me in the little example sheet I made when I was testing it. Did you look at Sheet2? Because the rows should be pasted into that sheet. If it is not working, attach your file and I will look at it.
    Last edited by wmorrison49; 09-28-2007 at 02:17 PM.

  4. #4
    Registered User
    Join Date
    09-28-2007
    Posts
    7
    I attached the actual file. I have been using sheet 3 to update from the web. I need the row to be copied from sheet three to sheet 2. I did edit the macro somewhat to include the ability to transpose so the rest works properly. I know the whole thing looks pretty ugly, but it is just a tool. I gutted a lot of the data other data out of sheet 3 to make the size small enough to send over, other wise that sheet is very large and very full.

    Basically what I currently have set up is for the data to be copied once I tell it which row it is in, and it copies to sheet 2 and is transpose. Then sheet 1 takes the data that I actually want to see from sheet 2 and updates the date, so copying the first row out of the data source is important. From there it is automatically entered into a archiver for trending and such.

    Again thank you so much for helping me out!
    Attached Files Attached Files

  5. #5
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    Sorry, this is a little too advanced from me being basically a VB rookie. Maybe you can modify the code from above that you said was working somewhat.

  6. #6
    Registered User
    Join Date
    09-28-2007
    Posts
    7
    Thank you very much anyway! Did you save your little trail spreadsheet? If you did please send it to me and I might be able to figure something out from it since you said it work for what you had it do!

  7. #7
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267
    I am am afraid I got rid of it. It was just words in column A and numbers in column B of Sheet1, then I ran the macro and the line in question got moved to Sheet2

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1