JamesonCreevey
New Member
- Joined
- Mar 8, 2021
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hello all,
I have absolutely no knowledge with Excel VBA and was tasked with fixing this Excel sheet at work. I am completely stumped and have tried just about everything so far to get it to work.
I have an import button for other Excel sheets that our emissions team creates for me to import to this specific sheet so we can check data and what not. The import function works and all of my If Then statements seems to work as it will always import into the correct sheet based on the data it has in specific cells etc... But we have about 5-8 different sheets so my boss would like for us to be able to import from any sheet on any line and automatically move the cells to the bottom of the correct sheet. The last part is where I am struggling, I can't seem to move the cells to the bottom. If I import from line 7 in a different sheet it will import to the correct sheet, just at line 7 instead of the bottom which causes a lot of issues. I know it seems like a lot but I'm sure it's a simple fix. Here is the code I used to try to fix this issue.
I've been searching for days and have tried just about everything but it still doesn't seem to work. So that's why I'm here, any help would be greatly appreciated as I am about to rip my hair out from this.
P.S sorry if this has been asked a million times, I tried searching for an answer but couldn't seem to find one.
I have absolutely no knowledge with Excel VBA and was tasked with fixing this Excel sheet at work. I am completely stumped and have tried just about everything so far to get it to work.
I have an import button for other Excel sheets that our emissions team creates for me to import to this specific sheet so we can check data and what not. The import function works and all of my If Then statements seems to work as it will always import into the correct sheet based on the data it has in specific cells etc... But we have about 5-8 different sheets so my boss would like for us to be able to import from any sheet on any line and automatically move the cells to the bottom of the correct sheet. The last part is where I am struggling, I can't seem to move the cells to the bottom. If I import from line 7 in a different sheet it will import to the correct sheet, just at line 7 instead of the bottom which causes a lot of issues. I know it seems like a lot but I'm sure it's a simple fix. Here is the code I used to try to fix this issue.
VBA Code:
Dim row As Variant
row = 6
Do While Cells(row, 1).Value <> ""
Cells(row, 1).Select
row = row + 1
Loop
Cells(row, 1).Select
I've been searching for days and have tried just about everything but it still doesn't seem to work. So that's why I'm here, any help would be greatly appreciated as I am about to rip my hair out from this.
P.S sorry if this has been asked a million times, I tried searching for an answer but couldn't seem to find one.