Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default subtotal problem


I have the following code which works well when I run the program fro
the "worksheet" module. However, if I try to run the main program fro
the "userform" module when I make my selections from my listbox, it doe
not work. Can someone help me with this..?

Sub sumthem()

dim i as long
dim rsum as single

For i = 1 to range("d800").end(xlup).row + 1
rsum = rnum + Range ("D" & i).value
If Range ("D" + 1).value = "" And Range (D" &
i + 1).Value = "" Then
Range("D" & i).value = rsum
rsum = 0
End if
next
end su

--
pcscs
-----------------------------------------------------------------------
pcscsr's Profile: http://www.excelforum.com/member.php...fo&userid=1200
View this thread: http://www.excelforum.com/showthread.php?threadid=27404

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default subtotal problem


-Hi,

why don't you try:-

Sub sumthem()

dim i as long
dim rsum as single

For i = 1 to activesheet.range("d800").end(xlup).row + 1
rsum = rnum + activesheet.Range ("D" & i).value
If activesheet.Range ("D" + 1).value = "" activesheet.And Range (D" &
i + 1).Value = "" Then
activesheet.Range("D" & i).value = rsum
rsum = 0
End if
next
end sub

-If this does not solve the problem replace "activesheet" b
Worksheets("ref"), where "ref" is an appropriate reference to th
worksheet you intend to process.

Let me know in case this does not work out,

urs

--
lenhardtur
-----------------------------------------------------------------------
lenhardturs's Profile: http://www.excelforum.com/member.php...fo&userid=1584
View this thread: http://www.excelforum.com/showthread.php?threadid=27404

Reply
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
Problem with subtotal function Constance Excel Worksheet Functions 0 March 17th 10 05:57 PM
Subtotal Problem Salman Excel Worksheet Functions 3 March 29th 07 10:08 AM
Subtotal command problem Martin B Excel Worksheet Functions 1 November 26th 06 01:34 PM
Subtotal problem. Very strange! Carl Excel Worksheet Functions 0 October 6th 06 04:07 PM
Excel Subtotal problem gmasson Excel Worksheet Functions 1 January 23rd 06 07:18 PM


All times are GMT +1. The time now is 06:32 PM.

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"