Posts by xiaowang

    How about

    Code
        Range(Range("H2").Value).Offset(, 3).Value = "Text"

    Hi Fluff13 excel recognizes it as a text and not as a cell address hence im unable to do that therefore im looking for other alternatives that allows the cell address to be recognized as a cell address.

    Hi ozgrid, is there any vba code that i can use to dervice the location from cell H2 and then offsetting it by 3 columns?

    Ie. If the contents in cell H2 is $a$3 , i would like to output a text in cell D3? Thank you in advance!

    Running every 12 hours does not ensure that the email is sent. There are ways to do that if needed. Normally, I leave Outlook open so it is not an issue.


    I have upload an example to run a routine on open. It shows a popup option to allow you to abort the run on open if opened manually. Using this method, I put the workbook into a Windows Scheduled run.

    Thank you!

    Hi may i know how do i run this at certain time intervals lets say every 12 hours? Thanks in advance!


    Hi ozgrid I’m currently proceeding with an equipment withdrawal system which uses a barcode scanner to scan their office ID. This allows the user to be able to press the check button which uploads their name, department and e-mail address. After the scanning of their office ID, they scan the item they want to loan out. For returns, the process is the same. The data when withdrawing and returning the items is captured into a database in separate sheets called “withdrawal_data” and “ return_data” this is achieved by a user form. One of the main features of this project is to be able to send out an email 3 days before the selected return date. However I do not know how to proceed with this. I have an idea to make the vba program execute a code to send the email out via a clickable button on the sheet. However I have no clue on how to make a program which counter checks against the return list to ensure the item has already been returned which ensures the email will not to be sent out. Some ideas that I have thought of are conditions to be fulfilled in order for the code not be executed the following are stated below.

    Conditions

    -The user in both the return and withdrawal section is the same

    -The borrowers email is the same

    -The loan return date is the same

    -The item returned and withdraw is the same

    Hence all this conditions have to be fulfilled in order for the email not to be sent out. The idea I have thought of is an VBA code which searches through the ‘return’ and ‘withdrawal’ sheet looking for the above conditions and outputting them into a sheet hence generating a sheet which contains the successful returns. In summary , I am able to send out the emails to remind them to return the items however I do not have a way to stop the emails from being sent out despite them already returning the items please help! Below is my excel file feel free to look through to understand it!

    Oh right..... Got it thank you!:)

    Hi could someone please explain to me what does the following do? Thank you in advance!

    Code
    -Set xRgDate = xRgDate(1)    -Set xRgSend = xRgSend(1)    -Set xRgText = xRgText(1) -xRgDateVal = xRgDate.Offset(i - 1).Value -vbCrLf = "<br><br>" 

    Hi royUk i have added it as a module and have also added it into the sheet1 however when i press run the dialog box has the run button still greyed out only the cancel button is available. Do advise thanks![ATTACH=JSON]{"data-align":"none","data-size":"full","title":"2019-11-12 08_52_51-Microsoft Visual Basic for Applications - Book1 - [Sheet1 (Code)].png","data-attachmentid":1226107}[/ATTACH]

    Hi all im new to VBA here. I'm not sure why when i try to run the macro it only has the cancel function and all other functions are greyed out please advise!!!
    [VBA]Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    If Target.Cells.Count > 1 Then Exit Sub
    With Target.Offset(0, 1)
    .Value = Now
    .NumberFormat = "MM/DD/YYYY hh:mm AM/PM"
    End With[/VBA]
    Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    If Target.Cells.Count > 1 Then Exit Sub
    With Target.Offset(0, 1)
    .Value = Now
    .NumberFormat = "MM/DD/YYYY hh:mm AM/PM"
    End With



    End Sub