Posts by ir121973

    Hi, I wonder whether someone may be able to help me please.


    I'm using the code below to count values from one sheet pasting them into another.



    The code works fine, but I'm trying to make a slight change to this, but I'm unsure how to proceed.


    The issue is this line of the code:

    Code
    For Each rcell In Range("C7:W7")


    This range selects the column header row and I still like to start from column C but end when it comes to the first blank column header.


    I just wondered whether someone could possibly look at this please and offer some guidance on how I may go about achieving this.


    Many thanks and kind regards

    Hi, I wonder whether someone may be able to help me please.


    I'm trying to use the file which can be found in the link below to try and perform the following:



    • Search the range "ADPeriod" for the value shown in cell in B2, and
    • Search the range "ADPLOB" for the value in the rows of column B,and
    • Search the range "ADJRole" for the value in row 2
    • Where all three are found,
    • Count the number of unique values in the range "ADSName" and enter the value in the applicable rows in column C of the table, then
    • Sum the associated value in the range "ADAFTE" and place in the respective row in column D of the table.


    I've done quite a bit of research on the web, and found a example as shown below, which I thought I could start from, and then amend, but I'm afraid my VB skills aren't quite up to scratch, so I'm having difficulties when doing so.



    I just wondered whether someone could possibly look at this please, and offer some guidance on how I may achieve this.


    In the near future, I will be adding further values in row C of the table, so I'd appreciate a suggestion that would take this into account and please find the link to the file here: http://www.dropbox.com/s/3iunr…nt%20%26%20Sum%20Test.xls


    Thank you and kind regards

    Hi, I wonder whether someone may be able to help me please with a problem I've been struggling with for days.


    I'm using the code below to extract specified data (via VB) from a 'Source' sheet "All Data" toa 'Destination' sheet "Monthly Direct".




    In it's current format, the header row is created in row 6, with the first row of extracted data paste into 1 row below.


    The problem I've got is that I would like to change this, so the first row where the extracted data is paste, is 2 rows below the header row.


    I must I had quite a bit of help along the way to get this far, and my lack of understanding is really hindering me.


    I just wondered whether someone may be able to look at this please and offer some guidance on how I may go about achieving this. If possible, I just wondered whether this could also include some short notes, so that I can learn from this


    To make things a little easier, I've attached a file which has the 'Source' "All Data" sheet which the data is extracted from, and a "Monthly Direct Expected Outcome" sheet which is what I would like to create.


    If you click the button on the "Macros" sheet, the sheet in it's current form will be created.


    Many thanks and kind regards

    Hi, I wonder whether someone may be able to help me please.


    Contained within a workbook, I have a sheet called "Team" with columns C:O and a dynamic number of rows within this range.
    Could someone perhaps tell me please how I may add the following formula to every cell within the range:

    Quote

    =100-'The Cell Value'


    Many thanks and kind regards

    Re: VBA Create Worksheets From Cell Values In Range


    Hi apo, thank you for taking the time to reply to my post and my apologies for not providing the full details.


    Unfortunately, I'm unable to post a sample workbook because of it's confidentiality, but I recieve the following error:


    'Run time error 1004 Application-defined or object defined error' and the line highlighted in 'Debug' is

    Code
    ActiveSheet.Name = ThisWS


    Many thanks and kind regards

    VBA Create Sheets From Range


    Hi, I wonder whether someone may be able to help me please.
    I've put together the following script which performs the following:


    • Search for names in column P of the worksheet in the workbook, then
    • By taking the unique names from this column,
    • Copies the related information a given range and pastes this into the respective sheet



    I have little bit of a problem though which I'm unsure how to resolve.
    If the cell in the column P is blank, the macro fails.


    I just wondered wether someone could possibly look at this please and offer some guidance on how I may be able to bypass these records.


    Many thanks and kind regards

    Hi, I wonder whether someone may be able to help me please.


    Using this link as a source http://en.kioskea.net/faq/2736…orksheets-based-on-a-list


    I've put together a very simple script shown below which creates sheets with the sheet name derived from cell values within a given range.


    Code
    Sub CreateSheetsFromAList()
        Dim MyCell As Range, MyRange As Range
         
        Set MyRange = Sheets("All Data").Range("P5")
        Set MyRange = Range(MyRange, MyRange.End(xlDown))
        For Each MyCell In MyRange
            Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
            Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
        Next MyCell
    End Sub


    The problem I have is that the source list can have multiple instances of the same value, so when I come to the second instance of the same cell value the macro fasils, which I what I would expect.


    I just wondered whether someone could look at this please how I may be able to look at the list and use the first instance only of the cell value to create the worksheets.


    Many thanks and kind regards

    I wonder whether someone may be able to help me please.



    I've been trying, for about a week now to put together a sheet which encompasses a 'SumIf' Formula based on a multiple criteria.



    I've been able to do this, manually entering the formula with the desired results in a cell range.


    The problem I have is that the skill level of some of my users is perhaps not as good as I would hope, so I know they won't be able to cope adding the formula themselves, so I'm looking at the option of using VB code, but I have to admit I'm a little unsure how to proceed.


    To perhaps illustrate this a little better, I've attached a file here https://www.dropbox.com/s/g22q…%20Macro%20Sum%20Test.xls which shows what I'm trying to achieve.


    The sheet "All Data" is the 'Source' sheet containing all the records I'm building the calculation on, and sheet "Slide 5" is the 'Destination' sheet where you will be able to see in the columns shaded orange the the formulas I've inserted manually which display the correct results.


    As I say, I've been working on this for a while, but I just can't come up with a solution.


    I just wondered whether someone could possibly look at this please and offer some guidance on how I may be able to achieve this.

    Re: VBA Sumproduct


    Hi royUK, thank you for taking the time to reply to my post.


    I've started off relatively simple to try and get the formula working, because once I do this, the finished formula will have dynamic elements contained within it, and will populate a range of cells.


    Many thanks and kind regards

    Hi, I wonder whether someone may be able to help me please.


    I'm trying to put together a 'SumProduct' formula via VB as shown below.



    The problem I have is that when I run this, I recieve the following message: Run-time error '1004' Application-defined or Object-defined error with Debug highlighting the formula row, but I'm not sure why.


    I just wondered whether someone could possibly look at this please and let me know where I'm going wrong?


    Many thanks and kind regards

    Re: VBA Extract Highest and Second Highest Values


    Hi apo, thank you very much for coming back to me so quickly with this, especially because, as you say, it is so late.


    Thank you also for taking the time to put the brief explanation together. I had initally tried just changing the line I highlighted in my last post and I couldn't get the script to work, hence my question. But I've gone back into the script and now got this to work, thank you.


    I look forward to receiving your notes when time allows.


    Once again many thanks for your time and trouble.


    Kind regards


    I look forward to receiving youir