Hi there.
here's the deal:
I have a file with a main userform that activates when the workbook is opened. On that userform, we have 2 options: "Creating an Entry" and "Replacing an "entry". I have done all the VBA code for the "creating an Entry" and it works perfectly but now I need to do some stuff that I have never done on VBA before:
Basically what I want it to do:
A new userform opens with several fields:
"reference number" input text-box (name= RefReplaceNew)
"title" input text-box (name= TitleReplaceNew)
"Category" input text-box (name= CategoryReplaceNew)
and then underneath another "reference number" (name= RefReplaceOld ) input text-box but this time for the data I want to replace in the database.
ALL OF THE ABOVE IS ALREADY DONE!
The problems start here:
I need Excel to search and find (hopefully) the second "reference number" in the column A (more than 3.000 entries) and then save the info from column A,B and C of that line (a simple 3 line variable with x = something; y = something and z = something should be enough to do that)
Then having saved that information, input in column A the information from RefReplaceNew), B the info from TitleReplaceNew) and in C info from CategoryReplaceNew.
then I need it to go to the first empty cell in column A and input the saved info from x in B the saved info y and in C the info in z.
-----------------------------------------------------------------
Also, one Massive thing: in the search engine, I need to be able to find the EXACT PHRASE as it will be a number I will be looking for and if I am looking for nuumber 123, I don't want it to choose 1234 if it has the chance.
And another thing: i want it to be able to say that I did not find such number if it didn't...
this is what I came up with for the search code
Dim cel As Range
Set cel = Range("A:A").Find(RefReplaceOld, LookAt:=xlPart)
If Not cel Is Nothing Then Cells(cel.Row, 1).Select
Any ideas?
here's the deal:
I have a file with a main userform that activates when the workbook is opened. On that userform, we have 2 options: "Creating an Entry" and "Replacing an "entry". I have done all the VBA code for the "creating an Entry" and it works perfectly but now I need to do some stuff that I have never done on VBA before:
Basically what I want it to do:
A new userform opens with several fields:
"reference number" input text-box (name= RefReplaceNew)
"title" input text-box (name= TitleReplaceNew)
"Category" input text-box (name= CategoryReplaceNew)
and then underneath another "reference number" (name= RefReplaceOld ) input text-box but this time for the data I want to replace in the database.
ALL OF THE ABOVE IS ALREADY DONE!
The problems start here:
I need Excel to search and find (hopefully) the second "reference number" in the column A (more than 3.000 entries) and then save the info from column A,B and C of that line (a simple 3 line variable with x = something; y = something and z = something should be enough to do that)
Then having saved that information, input in column A the information from RefReplaceNew), B the info from TitleReplaceNew) and in C info from CategoryReplaceNew.
then I need it to go to the first empty cell in column A and input the saved info from x in B the saved info y and in C the info in z.
-----------------------------------------------------------------
Also, one Massive thing: in the search engine, I need to be able to find the EXACT PHRASE as it will be a number I will be looking for and if I am looking for nuumber 123, I don't want it to choose 1234 if it has the chance.
And another thing: i want it to be able to say that I did not find such number if it didn't...
this is what I came up with for the search code
Dim cel As Range
Set cel = Range("A:A").Find(RefReplaceOld, LookAt:=xlPart)
If Not cel Is Nothing Then Cells(cel.Row, 1).Select
Any ideas?