Little help with merged cells

G

Guest

I'm writing that app in VB.net that goes into an excel file row by row and
extracts the information and stuffs it into an array for comparison later.

Problem is, I'm having trouble testing for merged cells (I can only catch
them in an error at the moment), and I can't seem to extract data from merged
cells.


Let me give some context to this. Lets say I have a group of data I want to
extract from a worksheet 7 cols wide and X rows long. Every X (random) number
of rows, there's a row of merged cells (e.g. f1:f7) as a header to seperate
groups of data.

How do I deal with these rows of merged cells when creating a range?

TIA!
 
D

Doug Glancy

Joe,

You'll probably get a better answer soon about getting the data, but this is
a start:

Sub test()

If Selection.MergeCells = True Then
MsgBox Selection.Cells(1).Value
End If

End Sub

hth,

Doug Glancy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top