Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the code below to populate a dialogbox. I only want this to work
if there is a value in the selected cell. If there is a formula and not a value then I want the Textboxes to be empty. Private Sub UserForm_Initialize() Dim rng Set rng = Cells(ActiveCell.Row, 1) TextBox1.Text = rng(1, 1).Value TextBox2.Text = rng(1, 2).Value TextBox3.Text = rng(1, 3).Value TextBox4.Text = rng(1, 4).Value End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe like this:
If Not rng(1, 1).HasFormula Then TextBox1.Text = rng(1, 1).Value End If Regards Rowan Patrick Simonds wrote: I am using the code below to populate a dialogbox. I only want this to work if there is a value in the selected cell. If there is a formula and not a value then I want the Textboxes to be empty. Private Sub UserForm_Initialize() Dim rng Set rng = Cells(ActiveCell.Row, 1) TextBox1.Text = rng(1, 1).Value TextBox2.Text = rng(1, 2).Value TextBox3.Text = rng(1, 3).Value TextBox4.Text = rng(1, 4).Value End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, that did the trick
"Rowan" wrote in message ... Maybe like this: If Not rng(1, 1).HasFormula Then TextBox1.Text = rng(1, 1).Value End If Regards Rowan Patrick Simonds wrote: I am using the code below to populate a dialogbox. I only want this to work if there is a value in the selected cell. If there is a formula and not a value then I want the Textboxes to be empty. Private Sub UserForm_Initialize() Dim rng Set rng = Cells(ActiveCell.Row, 1) TextBox1.Text = rng(1, 1).Value TextBox2.Text = rng(1, 2).Value TextBox3.Text = rng(1, 3).Value TextBox4.Text = rng(1, 4).Value End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome.
Patrick Simonds wrote: Thanks, that did the trick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
reactivate DialogBox | Excel Discussion (Misc queries) | |||
Dialogbox Creation | Excel Discussion (Misc queries) | |||
OpenFile dialogbox | Excel Worksheet Functions | |||
VB6 COM Add-In and Modeless Dialogbox | Excel Programming | |||
DialogBox | Excel Programming |