I have code where the user inputs a date, the macro finds this cell and sets rngFound as the location of that cell. The macro then creates a new workbook with new worksheet. Using rngFound as a reference, I need to sum the cells one below and five to the right and put this sum into a cell on the new worksheet.
I did a little research and found the offset which takes care of the referencing, but I cannot figure out how to incorporate this into a sum function in vba.
Below is my attempt. Previous to this part of the code, I am active in the newly created worksheet so I am attempting to input a formula based on offsetting the found range. Another problem is that I am going to have to repeat this step for 50 rows going down. Is there a way to set a loop? Or would I have to write out this code, changing the ranges and offsets 50 times?
I am trying to use an IF statment to look at 2 values, 1 from a defined range and the second based on offsetting the the first to Format a number of cells with a worksheet. Affectivley if the First Value is "E" and the value two columns to the left is a Sat or Sun I wish to format the row slightly differently from if it is a weekday. (There will be an M and a L as well)
I'm working in Excel 2010. I'm trying to create a dynamic range, using the OFFSET function. I've got it working beautifully but as soon as I save it and close the Name Manager the range stops working. When I go back into Name Manager I find all the cell references have changed (from C1:C600 to C1048572:C595 - or some other strange range).
P.S. What it's doing isn't so important as when the cell references are right it works. But just for full info: It's an OFFSET function, starting at A1. It will look at a list of companies and use a Match function to find out how many rows to offset (based on where the first instance of a particular company. And it uses the COUNTIF to make the range the same number of rows as there are entries for that company.
I have a macro where somone fills in a form and then it copies the data in the form to a database (another worksheet). Once the macro is run and has copied the form to the database, I then clear each cell seperately using the below code :-
I'm looking to look up sheet name based on a date, then look the date up within that sheet which is a merged cell, then return the figure in the corresponding cell.
I have a sample worksheet to attach, just have to work out how to do it.!
In the sheet "Cashflow Summary" in cell E24, i want to lookup the sheet name based on the value in C22 (merged cell), then lookup the date in that sheet (6 August 2014), and return the value in cell y8.
The difficulty is with firstly the merged cells, but also performing the lookup over a number of different arrays, as the sheets for each month, have the months listed under each other in rows of 5 days at a time.
the actual output of the error message when I run my macro. To repeat it, it says, "Regression - Having trouble offsetting input/output references"
The two button choices that appear on the bottom are "OK" or "Help." The OK button allows the macro to keep running (until it finds that it cannot find the regression output that was supposed to be created.
I have a worksheet set up where one column of data (we shall call it "A") is the result of several other columns' calculations (uses a formula referencing other cells). I have an entirely separate cell that also gets its data from other cells (we shall call this "B"). What I'm trying to do is make the shading of column "A" dependent upon data from column "B". For example, if column "B's" value is >24, I want column "A" to shade in red.
I am using excel as a base for formatting reports, and collating logical paragraphs, which I want to display in one massive merged cell on another worksheet.
The paragraphs are different for each report, and I do not wish to manually enter them in each time. I also want them to display as seperate paragraphs on the page, but in the same cell.
To throw a spanner in the works, the paragraphs are all of indeterminate length, otherwise, I could use different cells. If I combine them in the massive merged cell by using =cell1&cell2&cell3 then they will just appear merged as one whole huge paragraph. I want them to appear as separate paragraphs in the same big cell.
Is there any quick and easy way to unmerge merged cells and put the merged cell value in all the merged cells. For example, if I have A6:A15 merged together and its value is "FirstMerge" then I would like to unmerge all A6:A15 and then put "FirstMerge" in all the cell A6,A7,A8 etc. etc. upt oA15. I have lot of these merged cells in a sheet and I get this every month and makes any data processing very difficult. A macro or VBA code or any other solution will be fine.
I have many columns in my current spreadsheet but I have two columns that I want to split in to two project names.
Currently I have one column with: Project A/Project B And the second column with the total cost of Project A AND Project B combined
The thing is that I can easily just create a new line but that would mean all the data in the other Cells remain the same and the only two that will be different are the above two columns. I will be maintaining alot of rows so I was hoping I do not have to create two rows for every new item then to merge both rows in reach column every time I have to put in a new Item.
I am hoping to have for example the below
Name Comments Project Cost ------------------------------------------------- Item 1 This item relates Project A $150 to upgrade of Project B $120 SAS system ----------------------------------------------------
Currently I have it as
Name Comments Project Cost ------------------------------------------------- Item 1 This item relates Project A/B $270 to upgrade of SAS system ---------------------------------------------------
I would like to test how many cells have been merged in a given cell. I know about the MergeCells property which returns true if the cell is merged. But how do i retrieve the number of merged cells in that cell (supposing it is merged, of course).
Excel 2010. I need to place picture into one cell or one big merged cell, as a background fill. picture must resize to size of cell. must be fixed in, not in front. i still need write into that cell, so it needs to be really background.
I have 10 columns and 18 rows. Every 2nd row might contain a number. I need to sum those numbers, however, sometimes group of cells in a row can be merged and i value of a cell is then 0.
A1 to D1 merged; value 6 A3 to B3 merged; value 3 B5 to E5 merged; value 2
=sum(A1,A3, A5) would return 9 - correct =sum(B1,B3, B5) would return 2 - should be 11? =sum(C1, C3, C5) would return 0 - should be 8? =sum(D1,D3, D5) would return 0 - should be 8? =sum(E1, E3, E5) would return 0 - should be 2?
I have a spreadsheet that has been given to me by someone else, and unfortunately it has merged cells in it that are causing some trouble. I need to have a way to unmerge the merged cells, but for the data in the merged cell to then be copied into each cell that it splits into.
I've attached two spreadsheets - unfortunately I can't really attach the real one since it has research data in it, so I've reduced the size of the file and replaced some of the text. The first file shows how the file starts off, and the file named "result" shows how I would like it to be.
My real file contains some 10,000+ lines of data, and the merged cells are of varying sizes, with no consistency to the size, so I'd like a way to automate this instead of copy and pasting into every empty cell after I unmerge them.
I am working with a formula that has multiple embedded IFs and therefore references the same cell multiple times. However I am also copying it between workbooks for different companies so some of the information changes which column it is in. For example, there is a formula in AA5 that has 3 references to R4 and 4 to R5 and I need all of the R4 references to be T4 and all of the R5 references to be T5.
I can't do a "find and replace" because the formula in Y5 still needs to reference R4 and R5.
I have been clicking on R4 and dragging it 3 times to T4 (and the same for R5 to T5). It just seems like there should be a way to move all of the R4 references at one time to T4.
I want a total of column F based on criteria in column D and column K from the worksheet named in cell C9. I have put in the indirect function in the first part but am messing up the syntax in the second and third part of the formula. "Indirect(C9&" should be where 'Oct2009' is shouldn't it. Where am I going wrong with the following formula?
I've attached part of the file I'm working with, and can't figure out how to align the text to the top in the merged cells titled description. How do I format the cell so that if there isn't two lines of type in the description it remains aligned with the quantity and price
It is suppose to be that if the employee is "FT" and has worked >=4 years the return is 15. But if the employee is FT and has worked 2 years but less than 4 years then it is suppose to return 10 (these are days off) Or if the employee is FT and has worked 1 year, but less than 2 then it should return 5 days off. And all the others in the column get no days off.
I have tried to do it with structured references and with cell references I get a column of zeros!
I would like to paste cells from a contiguous range to a non-contiguous range using a list of cell references as the target paste cells. Both the target and the source cells will be on the same sheet. The source cells will contain an INDEX/MATCH formula - the result in each cell is what I wish to copy then paste. I would like to activate the code by assigning the macro to a button.
The source columns look roughly like this:
Title Index/match result Cell reference to paste to
Text 1 23 B5
Text 2 Peter H7
Text 3 Continuous D11
Text 4 [BLANK] F7
Text 5 Membrane J12
....... ....... .......
Text 57 Yes K33
The Target columns are all over, as shown by column three above. I would like the code to run though the full list of index match results all the way to the last 'Text 57' - the code can either skip blanks or paste these also, I don't mind. I haven't written the INDEX/MATCH yet so it may return zeros if there is no data to pull.
I attach the full example here. Entry Form EG.xlsx
Is there a way of writing a formula to create a reference to an external spreadsheet? I have a folder containing 100s of workbooks all based upon a template. I can create a directory listing of this folder using a macro within Excel.
e.g. Directory listing C:My DocumentsReturnsFile1.xls C:My DocumentsReturnsFile2.xls C:My DocumentsReturnsFile3.xls
I would then like to use this list of file paths to create links to several different cells within worksheets contained in each of these. I know that if I did this manually for each worksheet the formula would be a variation on =[C:My DocumentsReturnsFile1.xls]Sheet!Cell. Is there a way that I can automatically create these external references? i.e using values in column A (directory listing) to create many external references, say in column B
I use my directory list and then a formula or macro populates automatically these external references? The file names in the directory change daily (100s of worksheets!) so I don't want to have to manually input these each time. If the folder containing the workbooks was held on an intranet would there be a similar solution?