Error trying to populate new worksheet using macro
Solved/Closed
AmitMehta96
Posts
2
Registration date
Tuesday June 16, 2015
Status
Member
Last seen
June 30, 2015
-
Jun 29, 2015 at 01:07 PM
AmitMehta96 Posts 2 Registration date Tuesday June 16, 2015 Status Member Last seen June 30, 2015 - Jun 30, 2015 at 11:54 AM
AmitMehta96 Posts 2 Registration date Tuesday June 16, 2015 Status Member Last seen June 30, 2015 - Jun 30, 2015 at 11:54 AM
Related:
- Error trying to populate new worksheet using macro
- Network error occurred - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Cmos checksum error - Guide
- Bios rom checksum error - Guide
- Error code 230000 - Video Forum
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Jun 30, 2015 at 11:46 AM
Jun 30, 2015 at 11:46 AM
Hi Amit,
Let's take a look at this part:
Cells(1, Worksheets("Data").Columns(MyCell))
Cells(Row, Column)
You got the row, which is 1.
Now for the column. MyCell is a range, so a row and a column. So you have to let Excel know you want to use the column index from MyCell. This is done which the addition of: .Column
Here is the adjusted part:
Cells(1, Worksheets("Data").Columns(MyCell.Column))
Hopefully I have relieved you of the frustration and you can start enjoying VBA again!
Best regards,
Trowa
Let's take a look at this part:
Cells(1, Worksheets("Data").Columns(MyCell))
Cells(Row, Column)
You got the row, which is 1.
Now for the column. MyCell is a range, so a row and a column. So you have to let Excel know you want to use the column index from MyCell. This is done which the addition of: .Column
Here is the adjusted part:
Cells(1, Worksheets("Data").Columns(MyCell.Column))
Hopefully I have relieved you of the frustration and you can start enjoying VBA again!
Best regards,
Trowa
Jun 30, 2015 at 11:54 AM