Posts by hugletank

    I Have this code which I pieced together from various sources. It copies a row from Sheet1 to another worksheet named sum. It works fine but in the destination worksheet it doesnt paste data into row 1, instead starting at row 2. It means I can put a heading into row 1 on the destination sheet. I cant work out tho , what in the code tells it to choose row 2 instead of row 1? I know its this bit but cant see why it starts at row 2

    Code
    wksDest.Range("A" & Rows.Count).End(xlUp)(2)


    Heres the full code;


    Re: Summarise data from multiple sheets based on dates


    With some help I have this code now which does almost everything I want.


    I now only need help in determining if the date in column A is a specific number of workdays before todays date. Can someone provide some help with this?


    Heres my current code.


    Re: Summarise data from multiple sheets based on dates


    So I Managed to piece this code together which does most of what I want for an individual sheet.


    Could anyone help me to adapt the code to do the same for all of the 4 areas and also into column D what area the data came from?


    Code so far


    I have a workbook that contains four sheets. Each sheet is for a specific area, but the data on all the sheets is similar.



    I would like to summarise the data from all the sheets onto a new sheet that can be viewed and printed, but cannot be altered by the user. The only time the sheet will change is based on changes to the other four sheets. Hope that made sense!!



    I would like to use the date as the 'source' data so that any row that has a date of more than 2 working days ago (monday to Friday) will appear on the summary sheet.



    Can anyone help?



    Thanks in advance.

    I am trying to create a spreadsheet with 2 columns of data. Column A will show Cr or Db using data validation. Column B will be either one or several Cr followed by only one Db. The idea is to key the Cr amounts, and then the corresponding Db amount will 'balance it out. All figures in this column will be positive.


    So for example, in column A there will be 3 cells with Cr, there corresponding amounts in column B being 10 (totaling 30). The 4th cell in column A will then be Dr, and the 4th cell in column B will be 30, and so they 'balance'


    I would like to have a cell which shows the totals in a rolling format, showing how much is left, and then if the sets of data 'balance'. So from my example, the cell would first show 10 then 20 then 30 and finally balanced.


    Hope this makes sense.


    Thanks in advance for any help.

    Re: Why does this code not work every time?


    Thanks for the help. The 'tab' is just the keyboard tab button to move from textbox1 to textbox2.


    I have attached a copy of the file so you can have a look. As I have said, I am new to the whole VBA thing so its not great :)


    You can check if the email sends everytime for you. I have read that the SendKeys function is a bit unreliable. If you cant see why I am having these issues I may just put in a msgbox to tell the user to press send when the email pops up.


    Thanks again

    Re: Why does this code not work every time?


    It is my own userform, but all it does is gets some user input. There are 3 fields, which I transfer to cells in a worksheet and I use the keyboard tab to move between the fields. On random occasions the keyboard tab key doesnt move between the fields, but other times it does.


    I am still learning VB in excel, a lot of what I have showed you has been borrowed and I have tweaked it for my needs.

    Re: Why does this code not work every time?


    Thanks for the help so far macarius.


    I seem to have isolated the problem to coincide with the userform I have created not working correctly.


    When I fill the details in on the userform, I use the tab button to move from field to field. When the tab button works the code works. Sometimes, however, the tab button doesnt move to the next field, but tabs along the existing field. When the tab buttons doesnt move from field to field, the email doesnt send.


    Any ideas why this might be?

    I have the following code to obtain info from a userform and send an email with the details. The issue I have is that from time to time, the email will not send and just sits there waiting while the rest of the code completes, but the email never sends. Does anyone have an idea why this might be, or have any suggestions as to how to make sure it sends everytime?



    Any help would be greatly appreciated.