+ Reply to Thread
Results 1 to 8 of 8

Add rows and text to generated data. Macros?

  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    langley
    MS-Off Ver
    office 2010
    Posts
    6

    Add rows and text to generated data. Macros?

    Data.xlsx

    Hello All,

    I have attached an excel file that I hope someone can help me with.

    I've added comments in the cells of the attachment to further clarify, but here are the basics:

    In order to import the data to our accounting software we need to have certain data added to each transaction line (in red). With each transaction a new row must be produced above and below each original transaction and text added above the original of "TRNS" and below the transaction of "ENDTRNS".

    Ideally, I would like to have these added and a function to replicate all transactions to the end of the sheet.

    I have a sense that this would require Macros, but I'm not sure.

    Thank you very much.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Add rows and text to generated data. Macros?

    Should B1 to E1 be replicated for every row of data in the file?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    12-10-2012
    Location
    langley
    MS-Off Ver
    office 2010
    Posts
    6

    Re: Add rows and text to generated data. Macros?

    Hi Arlu,

    Ideally no, in the example I sent, no "cheque" text would be inserted in B3. If I were to create what I wanted for row 4, there would be a "cheque" text in B4 & B5, but not B6.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Add rows and text to generated data. Macros?

    What about this text in D1 - 1000.1 · Total Trust:1007 · Coast Capital - Trust?

    Should it be replicated in D4 as well?

  5. #5
    Registered User
    Join Date
    12-10-2012
    Location
    langley
    MS-Off Ver
    office 2010
    Posts
    6

    Re: Add rows and text to generated data. Macros?

    That would be amazing. In a perfect scenario the original data in Row 4:
    A new row would be added above Row 4 and replace the SPL with "TRNS", keep the "cheque", keep the same date, replace the text in D with "1000.1 · Total Trust:1007 · Coast Capital - Trust" and finally take the negative value of the value in E4 (170).

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Add rows and text to generated data. Macros?

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  7. #7
    Registered User
    Join Date
    12-10-2012
    Location
    langley
    MS-Off Ver
    office 2010
    Posts
    6

    Re: Add rows and text to generated data. Macros?

    Wow, that's all I can say. It worked and I'm extremely grateful.

    Thank you so much for your time and expertise, you are amazing.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Add rows and text to generated data. Macros?

    Am glad it worked.

+ 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