tb
Programmer
- May 27, 2003
- 328
Hi everyone,
I am quite new to VBA ... I've been programming mainly in VB for quite some time.
My problem is the following ...
I need to display a combo box in Column D when and if the user moves to that spesific cell. (not be displayed the whole time)
I've manage to determine when I am on Column D and I've managed to add a combo box to my spreadsheet
Found 2 ways:
** ActiveSheet.DropDowns.Add(0, 76.5, 96, 15.75).Select
** ActiveSheet.OLEObjects.Add "Forms.ComboBox.1",
Left:=10, Top:=10, Height:=20, Width:=100
What I am trying to do now is to resize and reposition the combo box to a certain cell as the user enters information in the sheet and navigate to the specified cell.
I can get the top, left ect of the cell, but the coordinates is waaaayyy out ...
MsgBox "TOP " & Target.Cells(lRow, 4).Top
MsgBox "LEFT " & Target.Cells(lRow, 4).Left
MsgBox "WIDTH " & Target.Cells(lRow, 4).Width
MsgBox "HEIGHT " & Target.Cells(lRow, 4).Height
What is the unit of measure of the above ?
Pixels/Twips/
Is there an easier way to determine where I should position the combo box?
Hope I've explained the situation well.
Any help, tips, hints would be much appreciated.
I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
I am quite new to VBA ... I've been programming mainly in VB for quite some time.
My problem is the following ...
I need to display a combo box in Column D when and if the user moves to that spesific cell. (not be displayed the whole time)
I've manage to determine when I am on Column D and I've managed to add a combo box to my spreadsheet
Found 2 ways:
** ActiveSheet.DropDowns.Add(0, 76.5, 96, 15.75).Select
** ActiveSheet.OLEObjects.Add "Forms.ComboBox.1",
Left:=10, Top:=10, Height:=20, Width:=100
What I am trying to do now is to resize and reposition the combo box to a certain cell as the user enters information in the sheet and navigate to the specified cell.
I can get the top, left ect of the cell, but the coordinates is waaaayyy out ...
MsgBox "TOP " & Target.Cells(lRow, 4).Top
MsgBox "LEFT " & Target.Cells(lRow, 4).Left
MsgBox "WIDTH " & Target.Cells(lRow, 4).Width
MsgBox "HEIGHT " & Target.Cells(lRow, 4).Height
What is the unit of measure of the above ?
Pixels/Twips/
Is there an easier way to determine where I should position the combo box?
Hope I've explained the situation well.
Any help, tips, hints would be much appreciated.
I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!