I have created an excel addin, the purpose of which is to run a piece of code attached below in code section, which iterates to each cell of excel and remove merged cells. I am getting a very basic error as my addin is not able to recognize the workbook which is opened and it returns Nothing for ActiveWorkbook object....
I have a question/problem on using Unmerge in VBA. I have a spreadsheet that in Column J has some cells/rows that are merged. I need to unmerge these cells. Not all rows have this merge, so I think there would need to be some sort of IF statement or something...but I'm not sure how to go about it.
I can say that if, for example, cell J19 is merged, it would be with K and L. Then maybe, J24 with K24 and L24 are merged. Then maybe J27 with K27 and L27....and so on. For the most part the sheet would have about 200 rows of data. But only would I find about 20 or so of these merged cells. I also have 19 excel files to do this to, or otherwise, I would just do it quick and dirty, manually-style.
As an added task, once the cells are unmerged I'd like to take the value found in cell O19 (same row as where the merge was found) and copy it into L19.
I have read the posts regarding merged cells and understand they should be avoided, but I am working with spreadsheets created by others. My problem is that I need to sort the data, but some of the cells are merged so it won't work. Is there a macro command to easily find the merged cells and unmerge them?
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 a workbook with multiple worksheets. On some of those worksheets a have merged cells, so in order to paste new data I need to unmerge them first. Below is the code that I wrote for it. However it doesn’t work and returns “Run-time error '1004': Application-defined or object-defined error”. I looked at this post List Maximum Value From Each Worksheet and tried adding With – End With, but it failed too. As far as I understood the problem is that the Worksheets/Sheets object does not support UnMerge property, but I may be wrong. If I add ws.Activate line (test2) everything works fine.
However I was wondering if there is a way to do it WITHOUT activating the worksheets.
Sub test1() Dim i As Integer, ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets Select Case ws.Name Case "5 - Top Network Facilities", _ "5b - Top Arb Facilities" For i = 0 To 9 ws.Range(Cells(2 + i * 5, 1), _ Cells(6 + i * 5, 1)).UnMerge Next i Case Else End Select Next ws End Sub
In the attached document, there are some cells which have been merged. For instance the cells A4 thru A7 were merged as one field. if you examine B4 which is actually made up of B4 thru B7 the data contained therein is 123. Is there a way to unmerge these merged cells and have the value (in this case 123) appear in each line of the unmerged cells? If you right click and click unmerge, it unmerges okay but does not populate each line with the data which was on the original field.
I am using Excel 2010 and have the problem as shown in the attached file.
Input Sheet shows the Data I have at present Output Sheet is the desired result.
I need a macro which should create an "Output" sheet by doing the following on the Input Sheet
1)Insert a Blank Column before Column A 2)Unmerge the Region Heading and insert the respective Region Name in the newly inserted Column. Region Heading will be in Bold Font. 3)Repeat Step 2 for all Regions 4)Delete the Rows which was merged.
Please note that the number of Data Rows will vary for each Region.
I have shown two Regions for explanation purpose only. There will be several Regions in reality.
I have a workbook that I am working with and I need to formatting the cells so that they will have multiple formulas and I am not sure how to make it work.
Sheet1 Column A is titled 'accounts'. There are 2700 rows under Column A that are being used. Column A is already formatted with a Vlookup formula so I can't add another formula in these cells.
What I need to do is highlight many ranges of these 'accounts' cells depending on their account numbers. I need to input this formula in a separate location on the spreadsheet. For example; If 'accounts' is >=110031100000 AND <=110031100099 then highlight those accounts in 'RED'. and If 'accounts' is >=1200454000000 AND <=120045400099 then highlight those accounts in 'green' and so on...I am not sure how to word the if statement. The formula must reside in column D or greater and not in A.
Am I going about this the wrong way. What I am trying to do is isolate the cells (accounts) that I have referenced on another worksheet so that I can visually notice any accounts that may have been excluded.
I have a forecast which is sorted by product code by week vertically. I need to create a lookup to re-format this information into a horizontal format by week. I have started this by transposing the information as my attachment shows but I am hoping there is a lookup formula which will be easier and quicker. I have attached the actual document and the data I want to sort is Sheet 2. I have started in Sheet 1. I want to look up the code in column A, then lookup the week number which would be B2 in Sheet 1 and return the value of that Code in that week from Sheet 1.
I will not open any debate on the subject, but just want to provide a solution to get rid of them automatically. Anybody who likes can refer to this thread.
WARNING This code is changing layout.
1. Could take a while when you have sheets with large used range or a lot of merged cells. You can follow the status and can interrupt it if you want.
2. Save before executing. I'm quite sure it works good, but the result might be something else then you had in mind, especially when you are quite new to this.
Option Explicit
Sub Unmerge_CenterAcross() 'Erik Van Geit '080808
'merged cells will be unmerged 'contents will be centered across merged area
Dim LR As Long 'Last Row Dim LC As Integer 'Last Column Dim i As Long Dim j As Long
Can we unmerge a complete address in seperate seperate coloumns? Like Complete address is "1st Floor, 2a Harrison Road, Erdington, West Midlands, B24 9AA" and i want to split it like Address[1] "1st Floor" , Address[2]: "2a Harrison Road", Address[3]: "Erdington"...
Is there is any formula which can split data with the help of seperators (Comma or space) ??
I have a protected sheet to avoid delete of functions. In a specific area, however, i have merged cells of five columns in rows. Because in these lines i have write some text and overcomes the rows, after, what i do is: i unmerge the rows and choose 3 rows from 5 columns together and merge. Thus, the text is in one framework. In fact, every time, i want to merge different regions, but always i want to merged any areas who have marked with the mouse. Then, i delete the text and i need to redo the context of three lines, three separate lines. I hope you understand what i need.MergeAndUnMerge.xlsm
I have a column of cells with values - 0.2%, 0.32%, 0.22, 0.5 etc. The cells with % symbol are in ' Percentage, 2 decimal' format while the plain numbers are in 'General' format i.e. column contains cells in either of these formats. I need a macro where I can specify the column and it will select the cells with the % format, convert it to 'General' and multiply the result by 100 eg. 0.2% converted to 'General' becomes 0.002. When multiplied by 100, result is 0.2 i.e. is displayed without the % symbol.
How can I format cells to contain Minutes, Seconds and Hundredths of seconds to be used in calculations eg 1.24.99 means 1 minute and 24.99 seconds. Example calculation is: 1.24.99 - 1.24.90 =0.0.09
1) My data is $42,397.40 is there a way that I can format for it to read $42.4?
I tried ROUND function and that did not work.=ROUND(A1,-3)
2) Cell A5 is Data:1/14/09 - 1/14/09. Since I only wanted the date, I used this formula =RIGHT(sheet1!A5,LEN(sheet1!A5)-FIND("-",Sheet1!A5)) which gave me 1/14/09. I need to set the format to look like 1/14/2009 but the data function would not recognize..
I want to apply conditional formatting in a cell based on the contents of another cell. I can do it if I just want it based off 1 condition (=b151="sample") but would like to if it met 1 of a couple possibilities.
For example, cell H151 I would like to fill green if cell B151 contained the text "sample" or "example". B151 has a list box with about 10 possibilities but I only want a few of those to turn H151 green.
I need a formulat that will ensure that a cell has 12 numeric characters,a dash, and then 3 more numeric characters. I thought this was a simple formula but I cannot get anything to work.
I am trying to format this function to just return the year, but I can't seem to get it to work. It just returns the full date and all I need is the year.
I am working on a spreadsheet that deals with times such as a work schedule, how every the schedule cells are in a time format, and my if function will only return "check"(which is false). my code works if it remove the time formatted cells but i want to keep the document in its orginal format.
I have bunch of data in the first column but there is always an identifier in this data at different location within each cell of the column. I am thinking the best way is to use the Find function. If true, then format the whole row.
For example: starting in row 10, I want the macro to look in A10, find "AFL" and if "AFL" is found in A10, then format row 10 by highlighting it yellow. Otherwise, highlight it red.
Var1 is a number, for example (3.2354896), displayed on the worksheet as 3.2 Var2 is a number, for example (3.958846), displayed on the worksheet as 4.0 Var3 is text, for example (lunch program) BullPoint = "greater satisfaction with Var3 (Var2 vs. Var1)" Range ("A1") = Application.Substitute(WorksheetFunction.Substitute(WorksheetFunction.Substitute(BullPoint, "Var1", Var1), "Var2", Var2), "Var3", Var3)
The result of this is now: greater satisfaction with lunch program (3.958846 vs. 3.2354896)
What we want to see is: greater satisfaction with lunch program (4.0 vs. 3.2) without losing the ".0" for the 4.0, which happens if we adjust the original data, using ActiveWorkbook.PrecisionAsDisplayed. Our preference is not to use this command, as it changes source data.
I have two worksheets which talk together and one of them gives a time stamp using some VBA code
=format(Now(),"dd/mm/yyyy AM/PM"
in the other spreadsheet I have the Now() function which has been working fine. However, when another user went into the spreadsheet went in it, my calculations between the two dates now error. I am presuming its because of the now function not having some formatting defined so is there anyway of changing this value? The cells-formatting will not obviously work as excel is getting confused between the two time types even though the format looks fine. To help the calculation that is messing up is
whereby L7 is the imported timestamp and J1 is now(). The calculation is to show which accounts become inactive after 10 days.
After reading up on the internet I know that to get round the problem I have to make sure that everyone is using the same regional settings. But I just have a couple of questions:-
1. I can understand the date calculation not working on the other persons machine, but when I went back to look at it I was getting the same error. Even though the file is shared, how come my settings didnt 'overwrite' and how come i was affected?
2. Is there a way to make the code work regardless of who opens it in whatever region? Im not sure if there is a fundamental problem but I cant rely on everyone having the same settings because I know that this will cause problems in the longterm.
3. Using the formuale Now(), is there no way of forcing that to a uk date format to stop the errors?
There is a spreadsheet I use at work where we are told to use an apostrophe before the date to prevent the function bar from converting the dd/mm/yy to dd/mm/yyyy. Why does the apostrophe do this?
I have an order tracking sheet that has start times in column B, end times in column C and the processing time in column A. The start and end times are recorded in ddmmyy hhmm format (9/1/09 13:30).
On another sheet I have dates listed for each workday. Next to these dates I am wanting a formula/macro that will traverse through column B and provide the number of orders and average processing time that match this. I also plan on recording the shortest and longest processing time next to these.
I saw there were codes to sum or count cells that have a specified Fill Color http://www.ozgrid.com/VBA/sum-count-cells-by-color.htm
However it says the changing of a cells fill color will not cause the Custom Function to recalculate, I really need to recalculate the data if there are any changes in the selected range