Posts by arslan_basit200

    Re: Copy the string from outlook to excel file


    I want to automize the excel macro with outlook, I want that when the email come to my inbox (always from one email id let say “[email protected]”) then it opens that email automatically, then it runs the macro which i wrote below and then copy the same email to the new folder.


    [code]
    Sub outlooktest()


    Dim myOlApp As Outlook.Application


    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myfolders = myNameSpace.Folders


    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True


    Set objWorkbook = objExcel.Workbooks.Add()
    Set objWorksheet = objWorkbook.Worksheets(1)


    n = 1



    Set myfolder = myfolders.Item(n)
    Set myfolder2 = myfolder.Folders("Inbox")


    c = 1
    n = 1


    For Each Item In myfolder2.Items

    If Item.SenderName = "[email protected]" Then
    mailtext = Item.Body

    objWorkbook.Worksheets(1).Cells(1, 1) = mailtext


    End If
    Next Item
    End Sub
    [\code]

    Re: VBA : Redirecting Emails


    Hello Everybody


    I also want something like this which is that when email comes to my inbox in outlook then the email opens automatically and also i have written other macro which is linked with the coming email which means the email comes from "[email protected]"[/email] then it open automatically and also the macro which i have written for this email run automatically

    Hello Every body
    I want to copy the string from Outlook email which comes from the same email id like "[email protected]"[/email] and also the structure is same for all incoming emails from this id "[email protected]"[/email]. In this outlook email there is one string name “Structure” like Structure: abc 2032_ppp_zzz that means in the output excel file only this string must be available (abc 2032_ppp_zzz). And when the new email come from the same id the excel file must be updated with the new string Structure, the email come directly in the inbox. And I am using MS Outlook with Office 2003.

    Re: Compare the data from two workbooks


    [INDENT]Hello Bryce
    Sorry for the late reply i want something like that please read this below


    I want to write simple excel command to compare two different workbooks and when the comparison matches then it paste the data in workbook 3 but the comparison must be done column wise The example is shown below (Comparison is done wrt column C ), All I know this can be done by vlook and compare command.


    Workbook1
    [TABLE="class: cms_table"]

    [tr]


    [td]

    Col A

    [/td]


    [td]

    Col B

    [/td]


    [td]

    Col C

    [/td]


    [td]

    Col D

    [/td]


    [/tr]


    [tr]


    [td]

    A

    [/td]


    [td]

    B

    [/td]


    [td]

    2

    [/td]


    [td]

    3425

    [/td]


    [/tr]


    [tr]


    [td]

    C

    [/td]


    [td]

    D

    [/td]


    [td]

    3

    [/td]


    [td]

    3452

    [/td]


    [/tr]


    [tr]


    [td]

    E

    [/td]


    [td]

    F

    [/td]


    [td]

    546

    [/td]


    [td]

    2345

    [/td]


    [/tr]


    [/TABLE]



    Workbook2


    [TABLE="class: cms_table"]

    [tr]


    [td]

    Col A

    [/td]


    [td]

    Col B

    [/td]


    [td]

    Col C

    [/td]


    [td]

    Col D

    [/td]


    [/tr]


    [tr]


    [td]

    X

    [/td]


    [td]

    Y

    [/td]


    [td]

    2

    [/td]


    [td]

    3425

    [/td]


    [/tr]


    [tr]


    [td]

    Q

    [/td]


    [td]

    W

    [/td]


    [td]

    3

    [/td]


    [td]

    3452

    [/td]


    [/tr]


    [tr]


    [td]

    F

    [/td]


    [td]

    H

    [/td]


    [td]

    55

    [/td]


    [td]

    2345

    [/td]


    [/tr]


    [/TABLE]




    Workbook 3(Shows the comparison with wb1 and wb2, the compared data from wb2 is updated in wb3)


    [TABLE="class: cms_table"]

    [tr]


    [td]

    Col A

    [/td]


    [td]

    Col B

    [/td]


    [td]

    Col C

    [/td]


    [td]

    Col D

    [/td]


    [/tr]


    [tr]


    [td]

    X

    [/td]


    [td]

    Y

    [/td]


    [td]

    2

    [/td]


    [td]

    3425

    [/td]


    [/tr]


    [tr]


    [td]

    Q

    [/td]


    [td]

    W

    [/td]


    [td]

    3

    [/td]


    [td]

    3452

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [/TABLE]


    [/INDENT]

    Hi Everybody


    I want to compare the two worksheets (column wise) in different workbooks let say if the column "K" of both worksheet have same id number then it must this full row with the relevent id number to the new Workbook it means accros each relevent id number i have two rows in workbook 3. Wait for somebodies help.

    Re: Compare the data from two workbooks


    Hello Thanks for your reply, but i didn't understand what you say. Actually i want to compare the data from two different workbooks and this command =INDIRECT("["&C3&".xls]Sheet2!$b$5:$d$9") have cell C3 where c3 use the function validation which means that in cell c3 there are two options "Slave 1" and "Slave 2" Slave 1 is in the wb1 and slave 2 is in wb2 when we click slave 1 it takes the data from wb1 and shows it and when we click slave 2 it shows the data from wb2, now i want to compare the data from these two workbooks which means if there is difference in these two workbooks then it must shows the difference, for this i have found this command =if(ISerror(compare(b5;$b$5:$d$9;0));"";b5) so i want to merge these two commands in which i am unsuccessful can you please merge these two commands as i am new in excel.

    Hello Every body
    I want to use two simple excel commands to compare the data from two different workbooks for example


    =INDIRECT("["&C3&".xls]Sheet2!$b$5:$d$9")
    &
    =if(ISerror(compare(F32;$G$19:$G$23;0));"";F32)


    Now i want to joint these two commands while these two commands works good independently but i try to join these two commands by following ways but they dont work, i don't know what's the problem is,


    =INDIRECT("COMPARE(c06;$d$06:$d$9));"";c06;["&C3&".xls]SHEET2!")
     
    =INDIREKT("COMPARE(c06;$d$06:$d$9));c06,["&C3&".xls]SHEET2!")
    =INDIREKT("COMPARE(c6;$d$06:$d$9;0));"";c6,["&C3&".xls]SHEET2!")
    =INDIREKT("COMPARE(E19;$G$19:$G$24;0));"";E19,["&C14&".xls]SHEET2!$C$5:$E$10")
    =INDIREKT("["&$C$3&".xls]SHEET2!,COMPARE(c06;$d$06:$d$9;0))")
    =INDIREKT("["&C3&".xls]SHEET2!;IF(ISERROR(COMPARE(c06;$d$06:$d$9;0));""c06")
    =IF(ISERROR(COMPARE(F32;$G$19:$G$23;0));"";F32)

    Re: Copy the range from one workbook to other Hworkbook.


    Dear Friend
    Thank you very much for your help. But i am facing the little problem in the code that you have written here it copy the data in the slave workbook or the workbook which we open, but i want to copy the data in the master workbook the workbook in which the code is written here master workbook is wb1, can you do some thing.....

    Hello Every body
    I have written the program which copy the green range from the other workbook to the master or current workbook if and only if the cell of the master workbook is green now the problem that i am facing is that it copy the green range to all worksheets which contains the green cells in the master workbook i just only want to copy the range to one worksheet can any body fix this problem.


    Re: Copy the data range from other workbook based on the color


    I have some how manage to write the code below. But this doesnot works very good, i want to copy the data from the slave or selected workbook and then paste it to the current workbook can you please change this code little bit.



    Re: Copy the data range from other workbook based on the color


    Hallo Dear,Thanks you really very much for your reply this is very useful for me certainly, but some how i also have manage to write the code it looks likes shown below.


    Code
    Sub rangeCopy()
    
    
    Dim rn As Range
    For Each rn In ActiveSheet.UsedRange.Cells
            If rn.Interior.ColorIndex = 35 Then rn.Value = Sheets(1).Range(rn.Address).Value    'where colorindex=35 for light green color
            Next rn
    End Sub



    This program works good but i have a problem in this program which is that this program works if and only if otherworksheet in the same workbook have green cells then it transfer the range to the green cells,
    but i want to modify this program like there must be one master sheet which ask "Please choose slave workbook" then we choose it and in the slave work book all range values with the colorindex=35 or light green must be transfered
    to the master sheet, but there must be the same technique to be used no copy paste technique. Hope you understand my problem. Waiting for your reply.

    Hello Everybody


    I have assigned a task in which there is one master sheet which uses the msgbox option to ask that which slave worksheet you want to copy then when we select the other sheet then it must copy the value and there is another restriction which is that it must copy the value from the slave sheet when the cell in the slave sheet is green, And also offcourse there will be the formulas in the other sheet so in the master sheet there must be the PasteSpecial command to be used.


    I hope i will get the relevant answer.


    I have written the relevant code but it works not so good. And also i am not expert in excel.


    Re: VBA: Paste Special (Values)


    Hello Everbody
    I have assigned a task in which there is one master sheet which uses the msgbox option to ask that which slave worksheet you want to copy then when we select the other sheet then it must copy the value and there is another restriction which is that it must copy the value from the slave sheet when the cell in the slave sheet is green, And also offcourse there will e the formulas in the other sheet so in the master sheet there must be the PasteSpecial command to be used.


    I hope i will get the relevent answer.