Posts by ashu1990

    Re: Auto lock selected cells from different sheets in a workbook after saving


    Hi pugoot6,


    Press ALT+ F11 and double click on Thisworkbook
    paste the code in Thisworkbook editor page


    Code
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim ran As Range
    Set ran = Range("F2:H8")
        ran.Locked = False
        ran.FormulaHidden = False
    ActiveSheet.Protect "Your Password"
     
    
    
    End Sub


    give the cells range into the Range("F2:H8") part
    Hope this helps

    Re: Copy selected cells from one workbook and past to another workbook


    Hi chris,


    i have made this code long time ago for 2 sheets hope this helps


    Re: Copy Mail content and paste it in Excel using VBA


    hi jsc,


    The code worked for me it copied the whole mail item into the cell A1


    any ways i tried this my self see if the code helps


    Re: Current year in listbox


    try this


    Re: Copy Mail content and paste it in Excel using VBA


    try this


    Code
    Sub extract_data_frm_cell()
    Dim str1 As Variant, i As Long
    str1 = Range("A1").Value
    
    
    str1 = Split(str1, Chr(10))
    For i = 0 To UBound(str1)
    Range("B" & i + 1).Value = str1(i)
    Next i
    End Sub


    this will extract the data from cell A1 and put the result into column B

    Re: import txt. file to excel with vba


    try this



    Hello guru's,


    i am not sure if it can be done but any thing is possible for the guru's


    Column A Column B
    [TABLE="width: 96"]

    [tr]


    [TD="width: 64, bgcolor: transparent"]I[/TD]
    [TD="width: 64, bgcolor: transparent, align: right"]10[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]I[/TD]
    [TD="bgcolor: transparent, align: right"]90[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]A[/TD]
    [TD="bgcolor: transparent, align: right"]30[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]B[/TD]
    [TD="bgcolor: transparent, align: right"]40[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]C[/TD]
    [TD="bgcolor: transparent, align: right"]50[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]I[/TD]
    [TD="bgcolor: transparent, align: right"]60[/TD]

    [/tr]


    [tr]


    [TD="bgcolor: transparent"]D[/TD]
    [TD="bgcolor: transparent, align: right"]80[/TD]

    [/tr]


    [/TABLE]


    i want the A,B,C,D large numbers but excluding the I into the range


    the formula so far i have tried is "=IF(A1="I",OFFSET(A1,1,0),LARGE($B$1:$B$7,1))"


    i am really clueless can any one help me?

    Re: Automatically copy last month's sheet and add it to a new sheet


    This will do your work the way you want


    Code
    Sub Add_sheet()
    Dim lstmonth
    lstmonth = Format(DateSerial(Year(Now()), Month(Now()) - 1, 1), "MMM")
    Sheets.Add after:=Sheets(lstmonth): ActiveSheet.Name = Format(DateSerial(Year(Now()), Month(Now()), 1), "MMM")
    Worksheets(lstmonth).UsedRange.Copy
    Worksheets(Format(DateSerial(Year(Now()), Month(Now()), 1), "MMM")).Range("A1").PasteSpecial (xlAll)
    Application.CutCopyMode = False
    Range("A1").Select
    End Sub

    Hi All,


    I am trying to send keystroke using send keys , i am sending cntrl + shift + S this combination help's to open the save as dialoge box inside internet explorer.


    But i am not able to use this sendkeys inside a VMware the code is running fine outside the vmware.


    when i run the code into the VMware nothing happens but the Num lock light goes off ! <--- whats the reason behind this?


    i am trying to save an .PDF from an internet explorer from a Bank website so the urldownload function doesnt work there as its .PDF path is not complete as per security purpose of the web site.


    also tried to set the cursor into the position of the internet explorer Command FILE and simulated a left click so that i can use the saveas option, but the setcursorpos dosen't work eiter.


    is there any other way to save a .pdf from a web site.