Search results

  1. U

    Subtotal by Month not Day?

    Right then I solved this one, Thanks Brian for the tip on the select case. Here's what I did: Firstly extract the month, then run the subtotals, use select case and a loop to pick out the totals text and put something more useful back into the date column, delete the first column. Column A...
  2. U

    How to selectively clear cells in a column

    I have had to copy a column of dates to a new column to extract the month and be able to make subtotals based on each month. Now I am trying to tidy up the column by removing all the cells containing the month and leave behind the subtotals. I have got a little way there using: lastrow2 =...
  3. U

    Subtotal by Month not Day?

    So here is where I have got to with this, I have managed to copy my range of dates to a new column with the following: lastrow1 = Range("D1").End(xlDown).Row Range("A2").Formula = "=Month(B2)" Range("A2").Copy Range("A3:A" & lastrow1).PasteSpecial And then successfully create subtotals based...
  4. U

    Subtotal by Month not Day?

    So I've managed to use: lastrow = Range("C1").End(xlDown).Row Range("D2:D" & lastrow) = Month(Range("A2")) To copy the first date in A2 and paste it to every cell in range D. But when I modified it to: Range("D2:D" & lastrow) = Month(Range("A2:A" & lastrow)) I get an error. Am I barking up...
  5. U

    How to sum a range of data?

    I got this to work using: lastrow = Range("B1").End(xlDown).Row Range("B" & lastrow + 2).Formula = "=SUM(B2:B" & lastrow & ")" Thanks for your pointers.
  6. U

    Subtotal by Month not Day?

    Thanks Brian for the pointer... I understand what you are saying and have tried a few things but i'm a but stuck from the beginning...what's the best way to copy to my date column to a new one using the month function?!!
  7. U

    How to sum a range of data?

    Hi Brian, Thats doesn't get very far...I get an error inside VBA editor saying Compile Error, Expected: End of Statement and it highlight B2. It seems it doesn't like the quotation marks very much!! Not sure if that provides any clues as to why I can't get this working?!
  8. U

    Subtotal by Month not Day?

    Hi, I have created some subtotals in some columns of data which for example are the dates, names, and amounts of invoices. The code I used is: Range(Range("C1"), Range("C1").End(xlDown)).Select Selection.CurrentRegion.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3) This is working...
  9. U

    How to sum a range of data?

    Hi, I am trying to simply find the sum of a range of data...I have tried putting the range into a the formula, and also creating aliases for the cells but it either doesn't work or I keep getting a name error in excel and I just can't seem to hit the nail on the head with right code: The range...
  10. U

    Understanding Excel formatting

    Hi, I am trying to export and then format a series of queries into worksheets in excel. I have managed so far to get this to work and I have managed to achieve some formatting but I don't really understand why it is doing what it is doing and some things that I think should work, don't!! Here...
Back
Top Bottom