Merge cell without specifying a range?

I am running a Powershell script with an XLSx function where I get output from multiple script and
the output are stored in seprate worksheets. In 2 of my worksheets I have row name for each column, I have managed to remove (blank) the duplicate row value. Now I am looking to merge those cells whose colA rows are blank. I understand that we need to specify
the range for the cells to be merge. Is it possible to merge without specifying a range?

Hi,
Would you like to share us a sample of the file? Based on your description, my understanding is that you want to merge the blank cells with above cells which include the value. And you do not want to assign the range. If it is, please try the following
code:
Sub MergeCells()
Dim LRow As Long
Dim MyRng As Range
Dim c As Range
Dim MergRng As Range
Range("A1").Activate
LRow = ActiveCell.CurrentRegion.Rows.Count
Set MyRng = Range("A1:A" & LRow)
For Each c In MyRng
If c.Value = "" Then
Set MergRng = Range(c, c.Offset(-1, 0))
With MergRng.Cells
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
End If
Next c
End Sub
Regards,
George Zhao
TechNet Community Support

Similar Messages

  • Merge Cells Without a Break?

    Post Author: JT21598
    CA Forum: Desktop Intelligence Reporting
    All,
    Basically what I am trying to do is merge some cells that have duplicate values in them.  The records themselves are not duplicates but there are certain values within those records that show multiple times and I would like to only represent these values once.  Here is a sample which might make this clearer.
    SECTION HEADER1
    Object1          Object2          Object3          Object4
      12                   13                  14                  15
      13                   13                  15                  16
      14                   13                  16                  21
    SECTION HEADER2
    Object1          Object2           Object3         Object4
      (Different value here than from before.)
    Basically what I would like to do is take the value in that is repeating in the Object2 Column in Section Header1 (13) and merge those cells together and center the number so that you can tell the one value is being used to represent the value in all three of the rows.  I have looked far and wide and the only way I have found to do this is with a break which will completely mess up the formatting of the report.  Any help would be greatly appreciated.  Thanks.

    Thanks, Gary. I did find a solution to the problem which I should have guessed earlier.
    1. My relief map is my master slide, and all my graphics are simply copied from Adobe Illustrator where they are made.
    2. My problem was the blink in the None transition, but I find that this is because I thought I had to have some type of Build chosen. This meant that my graphics had to await my master slide.
    3. I now discovered that if I put on the graphics from the previous slice and leave my build for these graphics as "None" (and the transition at "None"), then they will appear with my master slide without a blink.
    Thus I will try your suggestion above, but my immediate problem is solved. Many thanks!

  • Specifying a range of sheets in a formula

    I am new to mac and numbers.  I have a new iMac with Maverick.  Is there a way to sum the same cell in a range of sheets without having to have add all of them separately?  In other words, a way to specify a range of sheets?  Or, pehaps specify a named cell and sum all occurances of it on those sheets where it exists? Thanks...

    You can do something like this:
    Here is an example where the are four Sheets.  Each of the first three sheets contains a table titled "Table 1":
    1) Sheet 1
    2) Sheet 2
    3) Sheet 3
    4) Summary
    Sheet 1:
    Sheet 2:
    Sheet 3:
    Summary:
    In the Summary Sheet:
    Enter the Sheet names and Table names, and cell to reference in columns A thru C
    Then
    D2=INDIRECT(A2&"::"&B2&"::"&C2)
    this is shorthand for select cell D2, then type (or copy and paste from here) the formula:
    =INDIRECT(A2&"::"&B2&"::"&C2)
    select D2, copy
    select column D, then command click cell D1 (to unselect D1), paste

  • Excel Merge Cells.vi throws an undefined error in Excel 2013?

    Basically, I can't write text into an Excel spreadshoot using the Report Generation tools.
    Using LabVIEW 2013 (SP1) I am writing to individual cells in an Excel (2013) template.
    The error is coming from the Report Generation Toolkit>Excel Specific>Excel Easy Text.vi.>Excel Merge Cells.vi.
    Inside of the "Excel Merge Cells.vi" is an "Invoke Node.Range". When the program hits this point, it throws out an undefined error.
    My code has been running on multiple platforms in multiple programs with no problems using Office 2010.
    NASA upgraded our Office Suit to 2013. I am now throwing an undefined error ( -2146827284).
    I've got a service request in and have talked to an engineer. THey are looking at the problem. However, I thought I would throw it out here and see if anyone had seen this particular problem.
    Bryan Alexander

    Problem found, workaround implemented.
    When you use the "New Report.vi", you have to wire in one of four choices for the state of the window. "Maximized", "Minimized", "Normal" and "No Change". If you use the "Excel Easy Text.vi" to insert data into an Excel 2013 Spreadsheet, it will generate an error if you opened the Excel file in "Minimized" mode. The other three states work fine.

  • Is there a way of merging cells (not columns) in a Flex Datagrid?

    Hello everyone!
    I'm new to Flex and I have been searching for a solution to this problem for two days now, so any help would be really appreciated!
    I have a datagrid of, lets say x columns of fixed size, with the ability to add or remove rows dynamically. When adding a row o popup comes up and lets the user determine the positions(order) and widths of the desired cells of the row. So what I want to do is to be able to merge cells of the new Datagrid row appropriately, to satisfy the user's choices. Thats the general idea.
    Is there a way to have a Datagrid (or other similar component) with different cell number and widths for each row in Flex? I need a component similar to the Datagrid because I want to be able to select rows and process their data.
    Any idea would be very helpful as I'm pressed for time and I could use someone's experience to search in the right direction and not loose time.
    Thanks in advance!

    Thank you very much for your response. I finally did what I wanted without using a Datagrid. I used a Table Flex Component (which extends Flex Grid) that I found here:
    http://code.google.com/p/flex-table/#Demo
    I downloaded the source and changed some things to make it work as I need.

  • I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro D

    I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
    Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
    Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedback

    PDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
    This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
    (see ISO 32000 for what PDF "is")
    What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
    Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
    Be well...

  • Set Width for a column, Merge cells in Excel

    Hi all,
    I am using jacob.dll to open and modify an Excel file. And I am stucking in below trouble:
    Dispatch workbook = Dispatch.invoke(workbooks, "Open",
              Dispatch.Method,
              new Object[]"D:\\02042005.xls",
              new Variant(false), new Variant(false)},
              new int[1] ).toDispatch();
    Dispatch sheet = Dispatch.get(workbook,"ActiveSheet").toDispatch();
    System.out.print(sheet.get(sheet,"Name") + "\n");
    Dispatch a1 = Dispatch.invoke(sheet, "Columns",
              Dispatch.Get,new Object[] {"A:A"},
              new int[1]).toDispatch();     
    Dispatch.put(a1,"Width","8");
    Error message is that I can not set value Width for object RANGE! so strange... Is there any ways to set Width for a certain column?
    Any help is appreciated.
    Regards,
    YukiNguyen

    Hi all,
    :) At last I can work done with Jacob, so great :) take me all yesterday to find more... just hope this post can help someone like me save one day to find how :)
    //Get Range
    Dispatch orange = Dispatch.invoke(osheet,"Range",Dispatch.Get,new Object[]{"A1:I1"},new int[1]).toDispatch();
    //Get Column I & set Width
    ocolumn = Dispatch.invoke(orange,"EntireColumn",Dispatch.Get,new Object[]{"I"},new int[1]).toDispatch();
    Dispatch.put(ocolumn,"ColumnWidth","60");
    //Merge cell
    orange = Dispatch.invoke(osheet,"Range",Dispatch.Get,new Object[]{"C12:D12"},new int[1]).toDispatch();
    orange.call(orange,"Merge");
    Is it exciting, huh? :) I am trying to set HorizontalAlignment... beginner always stuck in somethings :)... but I have learnt so much
    Regards,
    YukiNguyen

  • Merge cells in JTable.......

    Plz some help me out ......i want to merge two consecutive cells of a row in one cell in JTable......... how to do that.....give some code if possible....

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • Merge cells in a JTable

    Hi there,
    I'm building a class which contains a JTable, and I'd like to be able to merge cells (both rows and columns, it depends on). I've just searched help on this forum, but in many topics, answers specify a link to
    http://www2.gol.com/users/tame/swing/examples/JTableExamples4.html
    or something like that, but this link is not enabled.
    Could someone give me some help, please ??
    Thanks.

    So I found the issue, and I'm gonna talk about it, because I think many people could be interested.
    Thus, 2 lines need to be changed. Those line are identical, and are as follows :
    TableCellRenderer renderer = aColumn.getHeaderRenderer();You just have to modify it with the following code :
    TableCellRenderer renderer = header.getDefaultRenderer();Those 2 lines are located in the paintCell() and the getHeaderHeight() methods.

  • Merge cell in DOI ?

    Hi
    I want to merge cell in DOI (Desktop Office Intergration)
    I know how can I do it in OLE , but I have no imformation in DOI
    I checked SAPRDEMO_SPREADSHEET_INTERFACE but there is no merging.
    is there anybody can give me some example about this.

    hi....
    this one is for merging cell in a range one after another in a mail merge templete
    call method MAIL_MERGE->MERGE_RANGE
      EXPORTING
          first        = (here you give first data record)
          last        = (here you give last data record)
          no_flush = no_flush
      IMPORTING
          retcode = retcode
          error     = error.
    regards

  • Un-merging cells

    Does anyone know how to unmerge cells without a huge mess being created? Say I merged 3 cells in a row, then select that 3 column wide cell and hit the "split cells into a column" button, instead of the cells splitting into their originals, they instead spit into really oddly shaped ones (2 cells, 1 1/2 normal cells wide, with 4 columns). How does this make any sense? Is there a way to restore merge cells to their original and normal selves if you ended up merging any number of cells that when divided by 2 makes an uneven number???? This seems like a major error in the program

    In my opinion, this is not a bug. To split cells into columns is the expected behavior of the "split into columns" button!
    However, I do agree that there should be an "un-merge" command too, just to restore the normal cell flow.
    Another shortcut command would be "split into columns/rows…" with a little window allowing to enter the number of desired cols/rows.

  • Is there any way for a formula to ignore other cells without data in them yet?

    I'm trying to create a spreadsheet to track my grades. I have all the formulas set up (quizzes, tests, etc. are calculated separately because they are all weighted differently towards the final grade). The "Final Grade" formula has an error because some of the other sets don't have data in them yet (i.e. haven't taken a test yet). Is there any way to get the Final Grade formula to ignore the cells without data yet?
    Formula for each category (quizzes, tests, etc): ((SUM [total point column]) / (SUM [total points possible column])) * 100
    Formula for Final Grade: (([quiz grade] * 0.15) + ([test grade] * 0.25)) * 100

    Hi badwolfgirl,
    I agree with quinn that merged cells can lead to many problems. Here is a table with no merged cells
    Two Header Rows, one Header Column and one Footer Row.
    I have used Cell Fills (colours) to distinguish Quizzes, Tests, Final Exam and Projects.
    Formula in Footer B8
    =IF(SUM(C)=0,"",100×SUM(C)÷SUM(D))
    if the SUM of C is 0 (zero), insert "" (NULL) to make it appear blank. Else insert 100xSUM(C)/SUM(D) to show the % score.
    Formula in C8
    =SUM(C)
    Formula in D8
    =SUM(D)
    Select B8 to D8 and drag the yellow Fill Handle to the right.
    If you want the appearance of merged cells, you can delete the contents of B1 and D1, then show No Border to the left and right of C1
    And so on for EFG etc.
    The cells are still there (to avoid problems down the track.
    Regards,
    Ian.
    Edited to rearrange paragraphs. Ian.

  • Writing merged cells vertically

    Hello,
    In Excel I can merge cells of the same column and write a text in those merged cells and put the text vertically.
    I try to do the same with Numbers '08 but was not possible.
    I know that I can insert a text box but this do not resolve my need, because I need a 4000+-row SS with 200 dates that need to be written vertically _ to save space — maintaining the path.
    Is this feature in Numbers '09 or — if you are an Apple insider — in Numbers '11?
    Extra: why is Numbers so much slow than AppleWorks SS?
    Thanks,
    Jorge Lucas (the guy from Rio Grande do Sul)

    Yvan,
    My interest in the iPad depends on 2 or 3 things:
    1) if I am able to build a better and bigger db that the one I already have functioning — for over 10 years — in the db module of AW (the one that you knew some years ago and that is better now, with its 255 fields (it is limited at 255) running fine;
    2) if I can get the pdf or e-book version of my text book ( I have the free paper version and I tried — unsuccessfully — to buy the digital copy (the book alone weighs 1 Kg);
    3) I need to see which Math apps I can have that substitute the ones I have on the MacBook;
    4) I was counting on the full versions of Pages, Numbers and Keynote — you put cold water on my plans.
    Apart from the classroom usage that would be something — just imagine, been able to hold it with one hand and write in the board with the other! — it would be nice to use it as an e-book reader and/or internet reader.
    But, if the iPad does not do the things I need, I am also considering a MacBook Air 13.3” (1.32 Kg), hoping that I can use AppleWorks in Lion or going to FileMakerPro.
    But even this option is hard to implement it because here we have to pay more than double the American price; and our salaries are very much less than the American.
    By the way, you said:
    I don't understand why FileMaker which is able to create FileMaker Go for the iPad is unable to do the same for the Mac. Bento is far from being an alternative to the AppleWorks DB module.
    The last hope I had about the inclusion of a DB module in the iWork suite, was gone after FileMaker made the list organizer Bento: it was very clear that they would not include the Filemaker Pro in the suite because it alone costs more than the all suite; so *+I thought that Apple would ask FileMaker to produce a flat version (not relational) — that could be named “FileMaker” (without the “Pro”)+*.
    They could charge for it the same as each of the existing 3 applications.
    Bento is very much less than this and because your thoughts on it, I never even tried it.
    So, I better wait the release of the new iPad, the iWork ’11, put some money together and find a way to make my teaching easier.
    +Thank you for the bad news about iWork for iPad.+
    Now, I am closer to the Air.
    Jorge Lucas (the guy from Rio Grande do Sul)
    Message was edited by: Jorge Lucas
    Message was edited by: Jorge Lucas

  • Copying cells without autofilling

    I'm using Numbers version 9.  I have a row of cells in a summary sheet that reference back to cells in a particular sheet.  Now I want to create other rows that reference the same cells in other sheets.  When I try to copy these cells to create the other rows, Numbers is autofilling (auto-incrementing the references) incorrectly.  Is there a way to copy a series of cells without autofill?
    Do I have to select each cell and change it's reference to absolute?
    Also, is there a way to select a bunch of cells and just change the sheet that's referenced by all the cells formulas?
    Thanks,
    Dave

    Hi Gavin,
    Here's the original formula from the post above:
    B2: =OFFSET(INDIRECT($A2&"::$A$1",),3,COLUMN()-1,,)
    The syntax for OFFSET is:
    OFFSET(base, row offset, column offset,rows,columns)
    The last two arguments are otional. If omitted, as they are in this formula, both default to 1, and the content of a single cell is returned.
    'base' is the address of the cell from which OFFSET starts. Here, it is specified using the INDIRECT function, which constructs the address as a text string. The content of cell A2 (on the table containing the formula) is the name of the table (ABIE) from which data is to be returned to row 2 of the summary table. The name from A2 is concatenated with the text "::$A$1" to create the address of the base—ABIE::$A$1.
    All data to be returned from ABIE is in row 4 of that table, three rows below $A$1, so the row offset is 3.
    In your case, the data is in row 25 of the table, twenty four rows below $A$1. Your row offset value is 24.
    The first piece of data to be returned is in column B of ABIE, one column to the right of the base, $A$1.
    the second piece is in column C, the third in column D.
    The COLUMN() function, with no argument supplied, returns the 'column number' of the cell containing the formula. In B2, it will return 2, in C2, 3, and in D2, 4. Each of these values is one more than the column offset needed to get to the column containing the data, so we can specify the column offset using COLUMN()-1, and the returned value will automatically adjust as the formula is filled right.
    That's true for the three columns of data in the example, and for the six columns of data in your case, provided the columns are contiguous.
    So for your case, assuming you are returning the data from row 25 of the source table(s), and that you are returning it to row 2 of your summary tabe. the formula requires only one reision:
    B2: =OFFSET(INDIRECT($A2&"::$A$1",),24,COLUMN()-1,,)
    Regards,
    Barry

  • Excel export are merging cells for data on multiple lines !

    Hello,
    I'm using Crystal Report XI R2, when we are doing an export to Excel with have an unexpected formatting.
    For example the value of the name is on 2 lines:
    => So, on Excel the result is on 2 lines but merged. We want to have this result only on one cells.
    Remark: if we delete the 2nd lines, because cells are merged we obtain the expected result.
    Proposal A:
    Are they any set-up available concerning the formatting of Excel ?
    Proposal B:
    Could we run some VBA when we click on Export button to make queries on the Excel ?

    When they introduced Unicode support in Crystal 9 (I believe), they had to completely re-write the export routines. At that time, they made a decision to change the functionality of the excel export. Crystal is attempting to remain absolutely faithful to the graphical layout of the report as you see it in the viewer. So it creates merged cell sections, empty columns between columns, and empty rows to give you as close to exactly what you see in the viewer as possible. Unfortunately, the result is typically less than useful. Iu2019ve had several conversations with Business Objects (now SAP) with regards to this when they changed it between versions 8.5 and 10, and they have no intention of changing the functionality as it now exists.
    There is a document which is now likely somewhere on the SAP portal that explains what you need to do to obtain the best results when exporting to excel.
    The jist of it is this:
    Line up all of the columns detail data with thier headers, and make sure that data fields are the same size as thier headers. 
    Line up all rows (headers and detail rows). (ie: select everything in the row, right click, align tops, and make the same height)
    cram everything as close together as possible. zero space in the report translates to zero extra collumns and rows in the export.
    the other option is to use the export to data only functionality, but that may not be what you're looking for either.

Maybe you are looking for

  • Intalling Adobe Acrobat 9.0 Pro before deactivating 8.0

    I installed 9.0 Pro and let the system walk me through the process.  It asked to uninstall 8.0 and I said yes.  But now I was told I had to deactivate 8.0 before uninstalling or I would lose that key.  Is this true?  Did I need to deactivate 8.0 or d

  • BT Shambles - Advice please with a house move....

    Is it me or is BT really taking the mick out of me? Ok; so I've been a BT customer for 8+ years in 2 homes; I moved into my 3rd home a month ago and did the home move online; however, it had an argument with me and referred me to the call center. I s

  • How to control portlet order in a page ?

    I have a portal page with three column flow layout. Each column contains unique portlet. I want to execute middle column portlet first, left and then right. i am setting some session value in middle portlet, i want to use that value in left & right p

  • Error in transaction SFP

    hello. when i create a form in SFP and go to the LAYOUT tab to create layout. it throw's me an error that 'no layout exist in language EN'. what does it mean? how to fix it?

  • IDML opens as "untitled" document

    Hi, When I open .idml file in InDesign, it opens as Untitled-# document. Is it possible that when I open .idml it opens as the filename instead of "Untitled-#"? What I have is bunch of .idml files, everyday I have to open them one by one, change a fe