+ Reply to Thread
Results 1 to 5 of 5

Extracting Data from Table by Looping

Hybrid View

  1. #1
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Wink Extracting Data from Table by Looping

    Hello All!

    What I am ultimately trying to do is extract data from many files within a folder. Within the files are "PlanNames", "IssueAge" "Duration" and "Factors." (Each file only has one plan name, but many issue ages and many factors) Each Factor represents another duration.

    I am currently on my first file of 17,000+. So far I have this coding

     Sub TerminalReserve()
    Dim TermReserve As Range
    Dim DurationAddress As String
    Dim PlanName As String
    Dim IssueAge As String
    Dim Duration As String
    Dim Factor As String
    Dim x As Integer
    Dim PlanNameAddress As String
    Dim rowdum As Variant
    Dim counter As Integer
    Dim ReserveName As String
    Dim IssueNameAddress As String
    Dim IssuingAge As String
    Dim FactorAddress As String
    
    
    
    'HardCoding of PlanName and Issue Age
       ReserveName = "20000001"
       IssuingAge = "10"
    
    
    'Creating Table Header
        PlanName = "PlanName"
        Range("G1").Value = PlanName
    
        IssueAge = "IssueAge"
        Range("H1").Value = IssueAge
    
        Duration = "Duration"
        Range("I1").Value = Duration
    
        Factor = "Factor"
        Range("J1").Value = Factor
    
    'Creating Duration, IssueAge, & PlanName Inputs
        x = 1
        While x < 101
        PlanNameAddress = "G" + VBA.Trim(Str(x + 1))
        IssueNameAddress = "H" + VBA.Trim(Str(x + 1))
        DurationAddress = "I" + VBA.Trim(Str(x + 1))
        Range(DurationAddress).Value = x
        x = x + 1
        Range(PlanNameAddress).Value = ReserveName
        Range(IssueNameAddress).Value = IssuingAge
        Wend
    
    
    'Selects TermReserve
    Set TermReserve = Range("A1:E869")
    TermReserve.Select
    
    'Inputs for Factor Table
    
    FactorAddress = "J"
    For Each rw In Range("TermReserve").Rows
    rowdum = rw.Value
    It creates for me everything I need so far, but the factors. I am in dire need of a code that will read the row (A3:E3), (A4:E4), (A5:E5), and so on and then orderly place them into column J.

    In the file is a snippet of what I have currently.Reserve Snippet.PNGReserve Snippet 2.PNG

    Advice would be greatly appreciated!!







    End Sub

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Extracting Data from Table by Looping

    Can you post an actual workbook? even if its just a mock up of how the data looks when imported and an example of how you want it to look after, Im afraid images are no good and many people dont even see them on this board.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,097

    Re: Extracting Data from Table by Looping

    Send an excel sample this will help to prepare macros
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Extracting Data from Table by Looping

    Macro.xlsm

    Thanks for your time and help!

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Extracting Data from Table by Looping

    Duplicate thread. Please do not reply to this thread. See http://www.excelforum.com/excel-prog...y-looping.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Extracting data from table using VBA looping
    By TexasBobcat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2015, 01:17 PM
  2. [SOLVED] Extracting data from a column in a table to another table/sheet
    By hoowill12 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-02-2014, 05:47 PM
  3. Looping through multiple files in a folder and extracting data from a specific tab
    By Bandicoot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2013, 05:24 PM
  4. Extracting data from table for related table
    By ikavdiya in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-05-2013, 03:20 PM
  5. Extracting data from a table based on a common entries with another table
    By shannoncox in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2012, 04:45 PM
  6. extracting data from a table
    By Andyd74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2006, 08:35 PM
  7. Looping thru files extracting data
    By gtslabs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2005, 12:05 PM

Tags for this Thread

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