Hi aatif,
I was able to repeat the error. I see the Problem.
The original code was written for a File where you had Headings in the First Row.
The codes, as i have written them, all require finding of the last Heading column, lc.
In the original code, this last column, lc, was determined by looking for the last heading in Row 1 using this line
Your new file has headings in column 2. You need therefore to get lc in a different way.
There are many ways to do this.
For example:
_ (i) Simply look in the second row with this Coode line
_(ii) Replace that code line with this which determines the last column in the whole sheet.
Note it would be wise only to use (ii) if you have nothing in the sheet to the right of your Input Table. Should you have anything then this code line will give you the last column in which anything in the sheet is
( (iii) Another possibility could be to determine the required Output Array size based on the last Address letter in the Array
arrFormattedCellsLtr()
____.. but this would require that you always choose to have the column Letter of the column furthest to the right as the last entry in that Array )
I checked the codes with the above modifications on your Files and they run now without error.
Here is part of your Input File:
Excel 2007
Row\Col |
C |
D |
E |
2 |
Item |
Units |
RTL GSM |
3 |
Height of corner C1 |
Mtrs |
0 |
4 |
Distance of corner C1 from tower |
Mtrs |
6 |
5 |
Height of corner C2 |
Mtrs |
0 |
6 |
Distance of corner C2 from tower |
Mtrs |
4 |
7 |
Height of corner C3 |
Mtrs |
0 |
8 |
Distance of corner C3 from tower |
Mtrs |
5 |
9 |
Height of corner C4 |
Mtrs |
0 |
10 |
Distance of corner C4 from tower |
Mtrs |
6 |
11 |
Building B1 |
|
|
12 |
Lattitude |
|
21.05136 |
13 |
Longitude |
|
81.7433 |
After running the modified code 2 times, part of the Sample File ( Sheet1 ) ( which originally has no data entries ) changes to look like this:
Row\Col |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
AA |
AB |
AC |
AD |
AE |
AF |
AG |
AH |
2 |
|
|
|
|
|
|
|
|
|
|
Lattitude |
Longitude |
Building Height AGL, in m |
No. of Floors |
Distance from Tower |
Azimuth |
Lattitude |
Longitude |
Building Height AGL, in m |
No. of Floors |
Distance from Tower |
Azimuth |
Lattitude |
Longitude |
Building Height AGL, in m |
No. of Floors |
Distance from Tower |
Azimuth |
Lattitude |
Longitude |
Building Height AGL, in m |
No. of Floors |
Distance from Tower |
Azimuth |
3 |
|
CG_ABHN_001-25_ABHANPUR.xlsx |
0 |
6 |
0 |
4 |
0 |
5 |
0 |
6 |
21.0514 |
81.7433 |
4 |
1 |
23 |
25 |
21.0512 |
81.7437 |
4 |
1 |
52 |
85 |
21.0508 |
81.74343 |
4 |
1 |
46 |
150 |
21.05137 |
81.74306 |
4 |
1 |
26 |
325 |
4 |
|
CG_ABHN_001-25_ABHANPUR.xlsx |
0 |
6 |
0 |
4 |
0 |
5 |
0 |
6 |
21.0514 |
81.7433 |
4 |
1 |
23 |
25 |
21.0512 |
81.7437 |
4 |
1 |
52 |
85 |
21.0508 |
81.74343 |
4 |
1 |
46 |
150 |
21.05137 |
81.74306 |
4 |
1 |
26 |
325 |
Hope that helps
Alan
Bookmarks