+ Reply to Thread
Results 1 to 3 of 3

Making report from log data by macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Making report from log data by macro

    Dear all, I am to do a report form log data with the help of some excel formula , but it was time consuming for me. I need to solve my problem by macro. Here Column A is my input data & form this Input I need to prepare report as Column form C to F . please have a look in the attachment , I have color marked that is the desire output .
    Attached Files Attached Files
    Last edited by nur2544; 10-20-2013 at 10:11 PM. Reason: Confidential

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Making report from log data by macro

    Try this macro

    Sub Test()
    For N = 1 To Cells(Rows.Count, 1).End(xlUp).Row
        If Cells(N, 1) Like "eanwhos@dhuas2*" Then
            CurrentBSEID = Mid(Cells(N, 1), 21)
        ElseIf Cells(N, 1) Like "DIP*" And Cells(N, 1) <> "DIP DOES NOT EXIST" Then
            N = N + 1
            MyString = Cells(N, 1)
            For X = 1 To Len(Cells(N, 1))
                MyString = WorksheetFunction.Substitute(MyString, "  ", " ")
            Next X
            MyArray = Split(MyString, " ")
        
            Cells(Rows.Count, 3).End(xlUp).Offset(1, 0) = CurrentBSEID
            Cells(Rows.Count, 3).End(xlUp).Offset(0, 1) = MyArray(0)
            Cells(Rows.Count, 3).End(xlUp).Offset(0, 2) = MyArray(2)
            Cells(Rows.Count, 3).End(xlUp).Offset(0, 3) = MyArray(3)
        End If
    Next N
    End Sub
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Making report from log data by macro

    Hi mrice, You did excellent job for me, it works very well , I really appreciate your job, thank you very much..

+ 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. processing data from multiple sheets and making report
    By ahsan79 in forum Excel General
    Replies: 3
    Last Post: 02-21-2012, 07:57 AM
  2. making one monthly report file from several daily report file
    By rasmara1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2010, 11:16 AM
  3. Making a report run faster
    By fodeps in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2009, 12:56 PM
  4. Making a Macro to create a report in word
    By draglin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2008, 05:17 PM
  5. Making a Report
    By Martyisbetter in forum Excel General
    Replies: 3
    Last Post: 08-07-2007, 05:31 AM

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