Click here to Skip to main content
15,913,941 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Drawing things FAST Pin
Klaus Probst7-Aug-01 15:45
Klaus Probst7-Aug-01 15:45 
QuestionResource limits?? Pin
Austin Jones16-Jul-01 11:15
Austin Jones16-Jul-01 11:15 
GeneralVB COM Testing Pin
amitrgholap16-Jul-01 1:09
amitrgholap16-Jul-01 1:09 
GeneralDAO Pin
sripriyaunni15-Jul-01 20:08
sripriyaunni15-Jul-01 20:08 
GeneralRe: DAO Pin
Fariborz4-Aug-01 6:22
Fariborz4-Aug-01 6:22 
Generalstart options of MS IE5.5 Pin
9-Jul-01 7:20
suss9-Jul-01 7:20 
GeneralRe: start options of MS IE5.5 Pin
9-Jul-01 11:07
suss9-Jul-01 11:07 
GeneralExcel formulae Pin
Ian5-Jul-01 20:38
Ian5-Jul-01 20:38 
Does anybody know how I'd get this to work?

I'd like to sort my spreadsheet so that I have duplicates one above the other (there will be two or more) I'd like to get it to do a calculation on a field where a cell has th sme account no. Something like

if ActiveSheet.Cells(1,4).Value = ActiveSheet.CElls(1,7).Value Then
ActiveSheet.Cells(1,7).Value = ((ActiveSheet.Cells(1,5).Value)-(ActiveSheet.Cells(2,5).Value ))
ActiveSheetRows(x).Delete End If

So if there are two rows with the same account no it will calc the contents. Id theres three it wil calc the three etc. Then it will delete all but the row with the answer in. Then move on to the next rows in the sheet and carry on from there.

Anyone have an inkling?

I can get it to look at a single rows values and set a format then delete all rows without the format but this isn't what I need:
'Write formula to first cell

Sheets(UserInput).Select
Worksheets(UserInput).Range("L1").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]>=RC[-1],0)"
Worksheets(UserInput).Range("L1").Select

'Copy the formula onto all cells
Selection.AutoFill Destination:=Worksheets(UserInput).Range("L1:L4000"), Type:=xlFillDefault
Range("L1:L4000").Select
Worksheets(UserInput).Range("L1").Select

'Find all rows where 0 has been set and delete them
num = 0
Do
Worksheets(UserInput).Columns("L:L").Select
On Error Resume Next
Selection.Find(What:="0", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
If Err.Number = 91 Then
End
Else
RowNo = ActiveCell.Row
Worksheets(UserInput).Rows(RowNo).Delete
End If

num = num + 1
Loop Until num = 3000

Please help


Generalright click and refresh Pin
Ian3-Jul-01 22:55
Ian3-Jul-01 22:55 
Generalmail attach Pin
3-Jul-01 13:37
suss3-Jul-01 13:37 
GeneralCode Editor for VB Pin
James Stigler3-Jul-01 12:11
James Stigler3-Jul-01 12:11 
GeneralRe: Code Editor for VB Pin
CodeCrafty®17-Jul-01 22:13
CodeCrafty®17-Jul-01 22:13 
GeneralGet selected row from a DBGrid control Pin
Ameenudeen2-Jul-01 14:51
Ameenudeen2-Jul-01 14:51 
GeneralPages in tif Image Pin
28-Jun-01 0:28
suss28-Jun-01 0:28 
Generalpivot table Pin
tamar yona27-Jun-01 20:07
tamar yona27-Jun-01 20:07 
GeneralEvents with an MTS COM object. Pin
Jamie Nordmeyer27-Jun-01 6:01
Jamie Nordmeyer27-Jun-01 6:01 
GeneralRe: Events with an MTS COM object. Pin
Klaus Probst7-Aug-01 15:49
Klaus Probst7-Aug-01 15:49 
QuestionHow can i use the UDP in the Web ?? Pin
khamis22-Jun-01 7:49
khamis22-Jun-01 7:49 
AnswerRe: How can i use the UDP in the Web ?? Pin
Klaus Probst7-Aug-01 15:51
Klaus Probst7-Aug-01 15:51 
GeneralShowing modeless form in VB DLLs called from MFC Pin
22-Jun-01 1:18
suss22-Jun-01 1:18 
GeneralFormatting duplicates in excel Pin
Ian21-Jun-01 23:16
Ian21-Jun-01 23:16 
GeneralString Pin
20-Jun-01 4:46
suss20-Jun-01 4:46 
GeneralRe: String Pin
20-Jun-01 16:00
suss20-Jun-01 16:00 
GeneralRe: String Pin
Michael P Butler20-Jun-01 22:35
Michael P Butler20-Jun-01 22:35 
GeneralRe: String Pin
19-Jul-01 10:07
suss19-Jul-01 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.