I'm back on a macro and I'm changing my technique a bit so I'd like to have your help please.
I have a CAD file with a family of parts of about 30 configurations whose names are loaded into a list through a For loop so that the user can choose the one they need. Each configuration represents diameter ranges of the same part: Config 1 = Part A with Ø0.1 - 1.0, Config 2 = Part A with Ø 1.01 - 3.0, Config 3 = Part A with Ø3.01 - 10.0 etc. Using the UserFroms I created, the user can fill in the diameter in the range he has selected (being a parameter). Then I would like the value written in the dedicated textbox to go to the cell of the part family whose row is that of the chosen configuration and the column corresponding to the diameter parameter. To do this, I need to find the position of the configuration cell, in reality the row is enough for me because I know that it is in column A and then shift to the right until I find the right column.
Explanation in pictures:
I'd like to know the line number of the red cell so I can write the value of the Ø in the green cell.
All this to say that I would like to find the position of a cell in VBA code please. I hope I have been clear and thank you for your answers,
As its without testing just in my head I would loop on all lines and as soon as your previously chosen value match then you execute your code (I'm not a big fan of Excel search functions :!)
set found = columns("c"). Find(what:=Diameter, lookat:=xlWhole) 'Find the 'Diameter' value as an exact value (lookAt:=xlWhole) in column C If Found Is Nothing Then' If Value Is Not Found
Msgbox "Diameter does not exist"
Else Row = Find.Row ' Returns the line number
End if
ActiveSheet.cells(row,"A") = activecells
Probably to tinker with a little, but it should help you a lot:)