LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Userform updating

Thanks Bob, i've nearly got it working except that i keep
getting

'Autofilter Method of Range class failed' as an error,
higlighting the first line.
any suggestions?

Thanks, Richard


-----Original Message-----
You will have to cut code but you can minimise it with

Private Sub UpdateTotals()
Sheets("Summary").AutoFilter Field:=3, Criteria1:="<"
Sheets("Cost Analysis - Overall").Select
Range("A2").AutoFilter Field:=2, Criteria1:="<"
Range("Summary!d38").Copy
Sheets("summary").Range("D50").Selection._
PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= False,

Transpose:=False
Sheets("summary").Calculate
TextBox45.Text = Sheets("summary").Range("D50").Value
End Sub

and then call this from each control, like

Private Sub CommandButton10_Click()
UpdateTotals
End Sub
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Richard" wrote in

message
...
I have a userform with many controls on it (dropdown and
checkboxes).

I then have a total field on my first sheet which

depends
on options ticked.
I have a text box which holds the running total, and is
updated by the following code attached to a command

button:

Private Sub CommandButton10_Click()
Sheets("Summary").Select
Selection.AutoFilter Field:=3, Criteria1:="<"
Sheets("Cost Analysis - Overall").Select
Range("A2").Select
Selection.AutoFilter Field:=2, Criteria1:="<"
Range("Summary!d38").Copy
Sheets("summary").Select
Range("D50").Select
Selection.PasteSpecial Paste:=xlValues,

Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Sheets("summary").Calculate
TextBox45.Text = Sheets("summary").Range("D50").Value
Range("a1").Select
End Sub

Is there a way i can get the update to occur every time
any of the controls are clicked, without having to out
code against every control?

Thanks in advance

Richard



.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform for updating records Terry Excel Discussion (Misc queries) 2 August 27th 08 04:16 PM
When updating a worksheet, how do I create a link updating the sa. Phlashh Excel Worksheet Functions 9 January 27th 05 06:05 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM
userform Antonov Excel Programming 1 September 2nd 03 04:25 AM
Updating .tag in Userform Control in VBA Chan[_3_] Excel Programming 1 August 20th 03 07:08 PM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"