1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Importing and comparing for header and footer in excel

Discussion in 'All Other Software' started by knighttrow, Jun 9, 2009.

Thread Status:
Not open for further replies.
  1. knighttrow

    knighttrow Thread Starter

    Joined:
    Jun 9, 2009
    Messages:
    7
    I need to take information from a separate excel workbook and add it to the information being output to the four note pad documents
    The code I have right now is:
    ..............................................................................
    Private Sub BigButtonOfDoing_Click()
    Dim target As Worksheet

    For Each target In Worksheets
    SheetStorage target
    Next

    End Sub

    Public Sub SheetStorage(target As Worksheet)


    Dim iFileForSheet As Integer, LR As Long, i As Long
    Dim strFile As String
    Dim strRec As String
    Dim qoutes As String
    Dim comma As String

    strFile = "C:\Documents and Settings\nicolas\デスクトップ\新しいフォルダ\DDLGanerator\output\" & target.Range("J4").Value & ".txt"
    LR = target.Range("C" & Rows.Count).End(xlUp).Row
    iFileForSheet = FreeFile
    Open strFile For Output As iFileForSheet
    For i = 5 To LR
    Print #iFileForSheet, target.Range("C" & i).Value; Spc(1); target.Range("D" & i).Value; Spc(1); target.Range("G" & i).Value; Spc(1); target.Range("J" & i).Value
    Next i
    Close #iFileForSheet
    End Sub
    ................................................................................
    There is the name of the document in cell j4. The information shown below is from a separate workbook that needs to be opened, compared against, then read in as the table name as the header, and the tablespace, initial, and next as the footer.

    TableName TableSpace Initial Next PS_NFS_JK_MAIN NFSPRJ 1M 1M PS_NFS_JK_HITO NFSPRJ 40K 20K PS_NFS_JK_TAIJIN NFSPRJ 2M 1M PS_NFS_HOSPITAL_MS NFSPRJ 40K 20K PS_NFS_JK_TAIBUTSU NFSPRJ 40K 20K PS_NFS_JK_SHARYO NFSPRJ 40K 20K PS_NFS_IMAGE_PATH NFSPRJ 40K 20K                 tablename is the same as in cell j4 in the main workbook, all the information shown here needs to be displayed like so.

    CREATE TABLE PS_NFS_HOSPITAL_MS
    (
    "information already inputted by above code"
    )
    TABLESPACE NFSPRJ
    STORAGE(INITIAL 40K NEXT 20K)
    /

    thanks
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/834051

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice