VBA Code to read the structure & data of an excel
Hi ,
I am currently working on an excel sheet . That excel sheet will contain merged cells rowwise and columnwise but not both.
I have to determine the structure as well the data of the excel file . Can any one tell me the code for doing it . I am doing my coding in visual basic text editor of excel file. so please send the appropriate code.
Currently i have developed the macro for reading 10 unmerged rows & columns.Here it is :-
Sub proRead()
'Taufiq Alam Khan
Dim Selectedvalue As Double
Dim Counter As Double
Dim Row As Double
Row = 0
Range("A1").Select
Do Until Row = 10
For Counter = 1 To 10
Selectedvalue = Selection.Value
'Selection.Value = 0
Selection.Offset(0, 1).Select
Next
Selection.Offset(1, -10).Select
Row = Row + 1
Loop
Range("A1").Select
End Sub
This will only read the first 10 columns and first 10 rows of the excel file having unmerged cells . if this code is used for merged cells then it will throw an exception . so kindly suggest some solution for it .............
|