Guru,
Thanks for the STAR.
With your description of "merged cells", and "the actual column count. eg. 31 instead of 5"... I take this to mean that your merged cells are merged "horizontally" - i.e. where you are merging columns (NOT rows).
I've just modified the example I created for your situation, and I now have 55 columns, with two sets of 2 merged columns.
The following variation of my previous example STILL works, EVEN WITHOUT "un-merging".
Sub Lookup_Variable()
nbr = 4
colm = 3
result = Application.WorksheetFunction.VLookup(nbr, Range("tbl"

, colm, False)
MsgBox result
End Sub
Actually, EVEN when the table includes MERGED cells that include BOTH columns and rows, the routine will STILL work. However, with such a table, you would need to have a very "special" situation to want such a "difficult" table to work with.
What makes such a table "difficult", is that there will be BLANK columns and/or rows for each "merged" set of columns and/or rows. You would THEN need to adjust your "offset" for the column or the row, in order to reference the proper cell containing the data you are looking up.
I hope all of the above makes sense, and that you're able to adjust your table accordingly.
If you still have difficulty, an option would be for you to email me your file (or a scaled down version). I then should be able to "pinpoint" the exact problem.
Regards, ...Dale Watson dwatson@bsi.gov.mb.ca