What cell is my data coming from?
Solved/Closed
BrianGreen
Posts
1005
Registration date
Saturday January 17, 2015
Status
Moderator
Last seen
September 30, 2021
-
Apr 5, 2015 at 12:18 AM
BrianGreen Posts 1005 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 - Apr 8, 2015 at 11:59 AM
BrianGreen Posts 1005 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 - Apr 8, 2015 at 11:59 AM
Related:
- What cell is my data coming from?
- Tmobile data check - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Gta 5 data download for pc - Download - Action and adventure
- Digital data transmission - Guide
- Data transmission cable - Guide
2 responses
MaxStart
Posts
339
Registration date
Tuesday March 3, 2015
Status
Moderator
Last seen
July 3, 2015
69
Apr 6, 2015 at 04:38 PM
Apr 6, 2015 at 04:38 PM
you really need to explain more ...
and you have to put in mind that there is no cell to the left of the column A:A, since your range starts from A1 and ends on D14
as on how to determine the left cell simply implement this method
and you have to put in mind that there is no cell to the left of the column A:A, since your range starts from A1 and ends on D14
as on how to determine the left cell simply implement this method
Cells(ActiveCell.Row, ActiveCell.Column - 1)
MaxStart
Posts
339
Registration date
Tuesday March 3, 2015
Status
Moderator
Last seen
July 3, 2015
69
Apr 7, 2015 at 07:38 PM
Apr 7, 2015 at 07:38 PM
I have the solution for u !!!!
but you need to tweak it up to fit your project.
I assumed that there would be multiple empty cells in column B and the values copied to the source sheet from the left cell of the one written by the code ...... bla bla bla .... you'll understand the code here it is, if you need further explanation I'm glad to keep up !!
dreaming is just a waste of time.
but you need to tweak it up to fit your project.
I assumed that there would be multiple empty cells in column B and the values copied to the source sheet from the left cell of the one written by the code ...... bla bla bla .... you'll understand the code here it is, if you need further explanation I'm glad to keep up !!
Sub go() Dim i, j As Integer i = 1 j = 0 Do While ActiveSheet.Cells(i, 1).Value <> "" If ActiveSheet.Name = "source" Then Exit Do End If If ActiveSheet.Cells(i, 2).Value = "" Then ActiveSheet.Cells(i, 2).Value = Sheet1.Cells(7, 7).Value Sheet1.Cells(7 + j, 8).Value = ActiveSheet.Cells(i, 1).Value j = j + 1 End If i = i + 1 Loop MsgBox ("List ended on cell A" & Cells(i, 1).Row) End Sub
dreaming is just a waste of time.
BrianGreen
Posts
1005
Registration date
Saturday January 17, 2015
Status
Moderator
Last seen
September 30, 2021
149
Apr 8, 2015 at 11:59 AM
Apr 8, 2015 at 11:59 AM
Superb!
Thanks Max.
A combination of both of your comments and melding it into the code I already have has done the job nicely and allowed me to rid myself of several lines of code just in that bit that was holding me back. I can also see where your code can replace lots of my coding in other areas of my script, so even more of my awful code can go!
Thank you so much for your help. (but I'm still not volunteering for any more coding jobs!).
Unfortunately the project is still not complete, but the end is in sight. Hopefully no more coding questions form me ... ever!
Thanks again.
Brian.
Thanks Max.
A combination of both of your comments and melding it into the code I already have has done the job nicely and allowed me to rid myself of several lines of code just in that bit that was holding me back. I can also see where your code can replace lots of my coding in other areas of my script, so even more of my awful code can go!
Thank you so much for your help. (but I'm still not volunteering for any more coding jobs!).
Unfortunately the project is still not complete, but the end is in sight. Hopefully no more coding questions form me ... ever!
Thanks again.
Brian.
Apr 7, 2015 at 04:26 PM
I did know about there are no cells to the left of column A but this is fully occupied with the data I need to copy - the first column with an empty cell is (should be) always in column B so fortunately the issue cannot arise - and if it does then it would highlight an error in the spreadsheet setup which must then be addressed manually. There would be an error handler built in so this will not be an issue ... I say that with lots more confidence than I actually have! (but even without an error handler the macro will stop with an error)
Perhaps Im being thick here, but I dont know how to make myself clearer on this. Basically I get a value from a sheet called "Source" from cell G7. The code I have then places it into the first blank cell on a different sheet (lets call it "Target" for this example) which is the active sheet - for this examples sake, lets assume the empty cell is C3. All this so far I have achieved with the script I put earlier.
Now the bit im stuck on is ..
I need to copy the data in the cell next to where I have just pasted (in this example sheet "Target" cell B3) and paste it into cell H7 on sheet "Source".
I believe I have come up with a chunky solution, but I'm sure it can be refined. I have incorporated your line and it seems to work on my test spreadsheet. Im not sure how scailable this is though - only the Gods know at this stage.
Thanks for your help, but if you can think of a better way then please let me know. (I do know that it is possible to manipulate sheets without making tham active and then switching back again, but its late and I need that bed that is calling me from afar.
Thanks Again,
Brian.