.Find causing userform to leave a Trail across the screen/disabling screen updating?

ender2309

New Member
Joined
Feb 11, 2015
Messages
1
Hi,

I've got a userform that uses the .find function to locate a date entered into a combobox (typed if new, selected from the list if it's already in there), and then pull four pieces of data into text boxes (manually entered if the date is new). The problem I'm having is that any time the function successfully finds a date and pulls in the data, it seems to cause a screen updating issues wherein the userform will leave trails across the screen like when you win in solitaire. This form is page two of a four page multiform, each page of which has different dimensions. So when the user finalizes on page two and returns to the main menu, there's this massive block taking up the center of the screen, along with images of message boxes etc. it goes away as soon as you close the form completely. I've posted the code in question below. The actual issue seems to lie with the code that pulls data into the userform - if i comment those lines out, no problem, but also the form becomes useless.

Does anybody happen to know of a solution or workaround for this? Enabling screen updating did not help.

Thanks for taking a look!

Code:
[FONT=Calibri]Application.ScreenUpdating = True[/FONT][FONT=Calibri]Dim strdate As String, Row As Integer[/FONT]
[FONT=Calibri]        strdate = Masterform.ComboBox1.Value[/FONT]
[FONT=Calibri]        strdate = Format(strdate, "short date")[/FONT]
[FONT=Calibri]        On Error Resume Next[/FONT]
[FONT=Calibri]        'searches DRATES for the date in the combo box. if the date is old, it gets pulled.[/FONT]
[FONT=Calibri]        Sheets("DRATES").Activate[/FONT]
[FONT=Calibri]With Worksheets("DRATES").Range("<wbr>G1:G1200")[/FONT]
[FONT=Calibri]    Set c = Columns("g").Find(What:=CDate(<wbr>strdate), LookIn:=xlFormulas _[/FONT]
[FONT=Calibri], LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False)[/FONT]
[FONT=Calibri]    If Not c Is Nothing Then[/FONT]
[FONT=Calibri]        Row = c.Row[/FONT]
[B][FONT=Calibri]        With Masterform[/FONT]
[FONT=Calibri]            .R1.Value = Sheets("DRATES").Range("H" & Row).Value[/FONT]
[FONT=Calibri]            .R6.Value = Sheets("DRATES").Range("I" & Row).Value[/FONT]
[FONT=Calibri]            .R11.Value = Sheets("DRATES").Range("J" & Row).Value[/FONT]
[/B][FONT=Calibri][B]            .R16.Value = Sheets("DRATES").Range("K" & Row).Value
       End With[/B]
[/FONT]
[FONT=Calibri]    End If[/FONT]
[FONT=Calibri]End With
[/FONT]
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top