Viewing Attachments In Current Threads

  • Hi, I am new to this, and I hope I am abidding by the rules here. I did a search of the question I am trying to figure out and found a current thread that answers the question (Re: "Macro" for splitting data into separate sheets?).


    The problem is that I can't seem to view the attachment that derk had provided. Can someone please tell me how to view an attachment off of a someone else's thread?


    Thank you so much!

  • Re: Viewing Attachments In Current Threads


    Hi Mac-


    I tried to open this attachment, but couldn't find any macros on it? I'm sorry! I'm wondering if you could maybe try it again, or is there anyway you could insert the code in the message box instead? Again, I apologize and apppreciate your help!!


    Thank you,
    Tracy

  • Re: Viewing Attachments In Current Threads


    I didn't realize you were looking for code. The message box was only to make you aware that the attachment was opened. What exactly are you seeking help with?


    Mac

  • Re: Viewing Attachments In Current Threads


    Oh, I apologize. In the thread, Re: "Macro" for splitting data into separate sheets?, they discussed how to use an IF function in a macro and copy those relevant rows into a separate worksheet.


    For instance, I would like to build a macro that says: If column C= Arkansas, bring back A1:G65536 (paste these relevant rows with data into a separate worksheet).


    I hope this makes sense?


    Thank you again,
    Tracy

  • Re: Viewing Attachments In Current Threads


    Hi Mac,


    Thank you for this. I did open the macro to try and view the code so I can write it myself. I don't see anything in the code that says, if=california? paste (range)? Am I not looking at it correctly? Also, if I want it to paste to a completely separate workbook (not just another tab), can I write this into the code? You've done enough, so no worries if you can't keep going with this. I appreciate it.


    Thank you,
    Tracy

  • Re: Viewing Attachments In Current Threads


    In the following code:

    Code
    Sub FindPaste()
    Dim iCell As Range
    
    
    For Each iCell In ActiveSheet.Range("A:A")
            If iCell.Value = "California" Then
                    iCell.EntireRow.Copy Sheets("PasteSheet").Range("A65536").End(xlUp).Offset(1)
            End If
    Next iCell
    End Sub


    iCell is a variable that represents a Range. This is used in a For Each loop to test each cell in the column. When the value "California" is found, the entire row is copied and pasted to the first available row on the "PasteSheet".


    I will have time later, from home, to explain more. For now, do a search for variables, ranges, loops, and copy method. I'm sorry I do not have time, now.


    I hope this helps,


    Mac

  • Re: Viewing Attachments In Current Threads


    Thank you so much! No, this is amazing. I have some work to do, but I think this is just what I need-definitely a great starting point.


    Thanks so so much again!!


    Tracy

  • Re: Viewing Attachments In Current Threads


    Hello again, tpampel!


    I have plenty of time, now. Instead of rehashing a years old thread, why don't you explain your data layout and what you would like to accomplish. Perhaps you can even attach an example. I'm sure we can work this out.



    Mac

  • Re: Viewing Attachments In Current Threads


    Surely you don't need code - AutoFilter, Advancced Filter or [pt]*[/pt] are all inbuilt options that could be used!

  • Re: Viewing Attachments In Current Threads


    Hi Mac,


    Thanks so much for your help. I am going to attach a sample spreadsheet. This is only a very small portion of a very large data export. I need to take this file and create a macro that says where column D= Dog, copy A1:F15 to a completely different workbook (the data will refresh every month and copy over the old data). I have placed the the 'desired results' below the data.

  • Re: Viewing Attachments In Current Threads


    Hi RoyUK,


    I could do this manually with an autofilter; however, this process has to be performed for over a hundred files each month, so I'm looking for a macro that will automate this. Thank you for your suggestion though!


    Tracy

  • Re: Viewing Attachments In Current Threads


    Hello tpampel!


    You say the results should be in a "totally different workbook". Would this workbook be a new workbook or an existing workbook? Where (Sheet name) in the workbook would the results be placed? Would the headings be the same as the headings in the current workbook?


    With a little information, this should be a fairly simple task.



    Mac

  • Re: Viewing Attachments In Current Threads


    The results would copied into an existing workbook (this workbook has multiple tabs but the tab that the data is refreshed into is named 'DataExp'). And, yes, the headings in that tab would be the same as the headings in the data export.


    Thank you again!


    Tracy

  • Re: Viewing Attachments In Current Threads


    Try this attached example. I threw it together rather quickly, so it's not pretty but I think it works. Post back for assistance.


    EDIT: In my haste, I forgot to mention in order for the code to work, you must set up a workbook named "Results Book.xls" with a worksheet with the name and headings mentioned.


    Mac

  • Re: Viewing Attachments In Current Threads


    Hi Mac!


    Okay, please don't kill me, but I tried this (a few times) and the input box came up to ask what value of data to search for. I entered 'dog' and it said, 'not found'.


    I tried this with the workbook that I had opened and saved as 'Results Book' with a tab named 'DataExp' with the same headers as the sample. I also tried this with that workbook not opened (I'm rather sure the code said that it would go in there and open it?).


    I'm really sorry, I've been trying to play with it all day--I didn't change your code or anything (because I'm sure it's something I'm doing on my end).


    Again, I really appreciate all the help you've given me. If you don't have time to look at this again, that's okay!


    Thank you so much!
    Tracy

  • Re: Viewing Attachments In Current Threads


    No problem, tpampel. I was under the impression you wanted to search by the item description(Column C). Try that and it should work. Then, we can make any changes you need to suit.



    Mac

  • Re: Viewing Attachments In Current Threads


    Mac! IT WORKED!!! thank you thank you thank you sooo very much!!!


    Thank you is not enough!!!...but THANK YOU!!!


    Very graciously,
    Tracy

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!