Originally posted by northernladuk
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: VBA advice
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "VBA advice"
Collapse
-
Originally posted by pjclarke View PostHave you been reading my diary? That sounds suspiciously like my plans for later this evening ...
Leave a comment:
-
if I get stuck and need a professional on the job
Leave a comment:
-
Originally posted by pjclarke View PostExcel dates are being stored as a number. With the integer particle is holding the date and the time is being as a decimal, so you must comparing the integer part of date cellular with the integer part of current date/timing. Isn't It?
Assuming your dates are coming in column 5 (or 'E') and mail addresses column 2 ('B') and the address data most correctfully is in rows 4 to 20, in a worksheet being named 'Data', something like:
Sub SendSomeMail()
Const DATECOL = 5
Const MAILCOL = 2
Dim Row As Integer
Dim EmailAddress As String
Dim DataSheet As Worksheet
Set DataSheet = Worksheets("Data")
For Row = 4 To 20
If Int(DataSheet.Cells(Row, DATECOL).Value) = Int(Now()) Then
EmailAddress = DataSheet.Cells(Row, MAILCOL).Value
'' Mail Function here
End If
Next 'Row
End Sub
Needful done. Payment to Shawaddidi Consulting, Jersey.
Many thankings.
Leave a comment:
-
Originally posted by northernladuk View PostBusted. I don't even know what VBA stands for let alone fix it
Leave a comment:
-
Originally posted by LisaContractorUmbrella View PostEmail address is contained within the spreadsheet - list will be updated regularly - each batch of emails will be around 20-30
If the email contents changes, then I would use Excel to generate a list of the email addresses to send to, separated by a comma, and then copy that into your email program as the CC/BCC list.
eg.
Col A = email addresses
Col B = date
Col C = =if(B=TODAY(),A,"")
Then have a function to concatenate all the values in C into one field, and copy that list of email addresses into Outlook (or whatever)
Leave a comment:
-
Originally posted by LisaContractorUmbrella View PostYep certainly can and payment when my problem is fixed So can you fix the problem and how much are you going to rush me NLUK??
Leave a comment:
-
In which case, if the length of the list may vary, you'll need to add some code to work out the end value for 'Row'.
PM me for a quote ;-)
Leave a comment:
-
Originally posted by DirtyDog View PostWhere is the email content defined? Is it in Excel as well, or are you trying to read the records from Excel into something else to compose and send the email? How many names are you talking about doing?
Leave a comment:
-
Excel dates are being stored as a number. With the integer particle is holding the date and the time is being as a decimal, so you must comparing the integer part of date cellular with the integer part of current date/timing. Isn't It?
Assuming your dates are coming in column 5 (or 'E') and mail addresses column 2 ('B') and the address data most correctfully is in rows 4 to 20, in a worksheet being named 'Data', something like:
Sub SendSomeMail()
Const DATECOL = 5
Const MAILCOL = 2
Dim Row As Integer
Dim EmailAddress As String
Dim DataSheet As Worksheet
Set DataSheet = Worksheets("Data")
For Row = 4 To 20
If Int(DataSheet.Cells(Row, DATECOL).Value) = Int(Now()) Then
EmailAddress = DataSheet.Cells(Row, MAILCOL).Value
'' Mail Function here
End If
Next 'Row
End Sub
Needful done. Payment to Shawaddidi Consulting, Jersey.
Many thankings.Last edited by pjclarke; 24 October 2013, 10:47.
Leave a comment:
-
Where is the email content defined? Is it in Excel as well, or are you trying to read the records from Excel into something else to compose and send the email? How many names are you talking about doing?
Leave a comment:
-
Originally posted by northernladuk View PostCould you supply an address to send our invoices to and what are your payment terms?
Leave a comment:
-
Could you supply an address to send our invoices to and what are your payment terms?
Leave a comment:
-
VBA advice
Morning chaps.
I am trying to automatically send out emails based on a list contained in Excel - I have written the code which will send the email but what I can't work out how to do is send it only when certain conditions are met i.e. when the date shown in the spreadsheet is today's date.
Spreadsheet format is basic with 5 columns but variable rows - name, email address, text column and then 2 date columns - I need code to send automated email to email address where the date in the corresponding row of the date column is today.
Hope that makes sense - any advice much appreciatedTags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Experts you can trust to deliver UK and global solutions tailored to your needs! Yesterday 15:10
- Business & Personal Protection for Contractors Yesterday 13:58
- ‘Four interest rate cuts in 2025’ not echoed by contractor advisers Yesterday 08:24
- ‘Why Should We Hire You?’ How to answer as an IT contractor Jan 7 09:30
- Even IT contractors connect with 'New Year, New Job.' But… Jan 6 09:28
- Which IT contractor skills will be top five in 2025? Jan 2 09:08
- Secondary NI threshold sinking to £5,000: a limited company director’s explainer Dec 24 09:51
- Reeves sets Spring Statement 2025 for March 26th Dec 23 09:18
- Spot the hidden contractor Dec 20 10:43
- Accounting for Contractors Dec 19 15:30
Leave a comment: