Excel VBA Merge Cells for a Table run time error"1004"

Anonymous
2020-02-09T15:51:00+00:00

Table AccessDownload (A1:H172)  Merge cells where dates are the same and if description is closing Balance

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

65 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-02-10T13:27:07+00:00

    V. Arya I don't have office 365 and I don't have one drive I use Icloud for windows and I'm changing the approach

    You'll notice that I changed my range to be more efficient ("A1:E172") and created 1 new column (column E) Grand Total

    How to write VBA code only for table and eliminate duplicates. I already have a Pivot Table and don't want to use Power Query

    Line 2:  where two dates are not equal and description is not "income Paid" =IF(D2="Income Paid",D2+D3,D2

    Line 3: where two dates are not equal but description is "income Paid" =IF(B3="Income Paid",C3+D3)

    Line 10 &11: where two dates are equal and description is "Income Paid" =IF(B11="Income Paid",D10+D11)

    At the end the table should have less lines and the final result should be posted in the new table. Thanks for your support

    Was this answer helpful?

    0 comments No comments
  2. Lz365 38,201 Reputation points Volunteer Moderator
    2020-02-10T07:52:50+00:00

    Yes Lz

    Hi JF_2010

    A Table in Excel is very comparable to a Table in a database. In database table you cannot merge 2 (or more) fields in the middle of a column (merging 2 or more full columns is OK though). Same goes horizontally for rows/records

    Look at following basic Excel table where A3:B3 is selected, option to Merge is greyed out:

    All this to say that if you expect to merge some cells according to your criteria you must 1st convert your Table to a Range

    Hope this makes sense & helps + Good luck for the VBA part (I don't like coding), I'm sure Jeovany & V.Arya will be to assist further if required

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2020-02-10T06:15:22+00:00

    May I request you to post the file with dummy data (no production / real data) to Onedrive or any other cloud sharing site and post the link here? If you need help about how to do - https://support.office.com/en-us/article/share-...

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-02-09T19:39:52+00:00

    Yes Lz

    Was this answer helpful?

    0 comments No comments