+ Reply to Thread
Results 1 to 7 of 7

Need help for creating a Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    11-19-2014
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    3

    Need help for creating a Macro

    Hi Friends,

    I need a help and want to do this with macro could anyone of you please help me

    • From the “Functional Sheet” Go to “Description column and Copy first “SIS Line 2”.
    • Go to tab “Data Element” Search for it in “Description column” and in which so ever row the match is found
    • “Traceability Tracefrom” column of Data element sheet gets populated with functional sheet “ID” column corresponding to “SIS Line 2” which we copied that is “UW-F1”
    • Similarly for rest of the rows that is SIS Line 2,3,4 etc SS line 1,2,3 etc, O line 1,2 etc

    Please find attached template

    Thank You in Advance.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help for creating a Macro

    Hi Michael,

    Welcome to the Forum!

    If no one solves your issue in the interim - I'll look at this tomorrow
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    11-19-2014
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    3

    Re: Need help for creating a Macro

    Quote Originally Posted by xladept View Post
    Hi Michael,

    Welcome to the Forum!

    If no one solves your issue in the interim - I'll look at this tomorrow
    Sure I ll full star rating... could you please look into whenever you get time i need to work on a big sheet and present it tomorrow

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help for creating a Macro

    Hi Michael,

    Is your sample correct? You've got as many as 5 descriptions in the top rows of the data element sheet and none in the last rows??

    There are three rows with no description after I spread them out. So, I assumed that your sample was incorrect - if, I'm right then try this:

    Sub MRossely(): Dim wf As Worksheet, wd As Worksheet, F As Range, D As Range, r As Long
    Dim IDF As String: Set wf = Sheets("Functional"): Set wd = Sheets("Data Element")
    
    For Each D In wf.Range("C2:C" & wf.Range("C" & Rows.Count).End(xlUp).Row): IDF = D.Offset(0, -2)
            Set F = wd.Range("C:C").Find(D, , , xlWhole)
            If Not F Is Nothing Then
            r = F.Row
            Do
            F.Offset(0, 4) = F.Offset(0, 4) & " " & IDF
            Set F = wd.Range("C:C").FindNext(F)
            
            Loop Until F Is Nothing Or F.Row = r
            End If
    Next D
    End Sub

  5. #5
    Registered User
    Join Date
    11-19-2014
    Location
    USA
    MS-Off Ver
    MS office 2010
    Posts
    3

    Re: Need help for creating a Macro

    Sheet is correct those are sample data once I will get the macro written for 335 rows .... I will populate that all field of description.
    Kindly consider the top 5 rows....similar data will be there in rest of other rows.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help for creating a Macro

    Ill look again tomorrow.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help for creating a Macro

    Hi MIchael,


    Try this:

    Sub MRossely(): Dim wf As Worksheet, wd As Worksheet, F As Range, D As Range, r As Long
    Dim IDF As String: Set wf = Sheets("Functional"): Set wd = Sheets("Data Element")
    
    For Each D In wf.Range("C2:C" & wf.Range("C" & Rows.Count).End(xlUp).Row): IDF = D.Offset(0, -2)
            Set F = wd.Range("C:C").Find(D, , , xlPart)
            If Not F Is Nothing Then
            r = F.Row
            Do
            F.Offset(0, 4) = F.Offset(0, 4) & " " & IDF
            Set F = wd.Range("C:C").FindNext(F)
            
            Loop Until F Is Nothing Or F.Row = r
            End If
    Next D
    End Sub

+ 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] creating a macro that inserts the current date in the same cell everytime the macro is run
    By katie1994 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2012, 07:59 PM
  2. help with macro - creating new columns/copying/creating new worksheets from default
    By vsantoro in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-17-2010, 09:29 AM
  3. Creating a macro to auto-update external data and time macro was excecuted
    By UNWATCHABLE in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2010, 05:21 AM
  4. Replies: 3
    Last Post: 12-15-2009, 10:22 AM
  5. Creating a macro which presses a button containing a recorded macro
    By petros89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2005, 10:05 AM

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