Finding and Amending a record
Hello,
I am having trouble with what appears to be a simple task! I have a few forms which I am creating (have previously been here for help on other aspects of creating these!). Basically, I have set up a 'menu' form which can take you to one of three forms, the first form is working great, this one inputs to the spreadsheet with the data which you input (then press a 'submit' button). the next form is to go on to the next stage of the record which is adding more data after 6 months (only two cells). The third form isnt even nearly done as it is roughly the same as the second form and once i have done that the last should be a breeze. The trouble i am having is I have got to the stage where i need to look up from a unique number to find the right line and then add the two bits of information to that line, (and then go on to finding the next record etc etc until you are done adding). I have tried to achieve this with various snippets of code which others have kindfully added as solutions to other similar problems but I cannot get anything to do what i want. Perhaps i am trying to go to far too quick as although i can learn things as i go along, before 3 weeks ago i had never touched VB in my life. I have only just learned the offset command and the xldown and other small bits! Perhaps someone could help me with the concept and perhaps explain what the command does? (I am pasting a line of code which i have tried to get to work to no avail) Selection.Find(What:=Interiminput.regint.Text, After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlBycells, SearchDirection:=xlNext, MatchCase:=False).Activate Many thanks in anticipation. Duncan |
Finding and Amending a record
(just to add, I tried the vb help and the code it gave as the find done
nothing except fill in the cells with a "5". not very helpful!) |
Finding and Amending a record
Ok,
I have managed to get that code to work, It was looking xlbycells and not xlbyrows, also removed the after as i didnt think i needed it. now i need to select what i have found so that i can go on to offset and add info to that row and so on. Is it possible to select it as i havent really selected that cell so far, it is only finding it within a selection. have i got that right or am i being stupid? |
Finding and Amending a record
Please ignore this topic, I have experimented a bit and found the
answer was pretty simple. (it was already selecting the cell when it found it all i needed to do was start offsetting and putting the data in) |
All times are GMT +1. The time now is 12:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com