Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Sheeloo,
I have sent yo uexample file. Can you please check.. Kam. "Sheeloo" wrote: append @hotmail.com to to_sheeloo or click on my name for instructions to get the mail "Kamlu" wrote: Hi Sheeloo, Thanks for your help. I have checked this Macro & it is giving output but not to 100%. Can you please give me email ID so I can send you example file. Kam. "Sheeloo" wrote: Chris, This will not work as there may be one, two or more than two rows for a Bill No. "Chris Bode via OfficeKB.com" wrote: You can do this using a macro Please follow following steps 1.Right Click toolbarclick control box 2.From control box select a command button and draw it to your sheet 3.Double click the command button to open code window and paste following codes Private Sub CommandButton1_Click() Dim row As Integer, col As Integer row = 2 col = 2 Dim amt1 As Double, amt2 As Double amt1 = 0 amt2 = 0 While Sheet1.Cells(row, col).Value < "" If Sheet1.Cells(row, col).Value = Sheet1.Cells(row - 1, col).Value Then amt1 = CDbl(Trim(Sheet1.Cells(row, col + 2).Value)) amt2 = CDbl(Trim(Sheet1.Cells(row - 1, col + 2).Value)) If Abs(amt1 + amt2) <= 10 Then Sheet1.Cells(row, col + 3).Value = "C" Sheet1.Cells(row - 1, col + 3).Value = "C" End If End If row = row + 1 Wend End Sub Now you will get the result on clicking the command button Hope this one works for you Have a nice time€¦. Chris ------ Convert your Excel spreadsheet into an online calculator. http://www.spreadsheetconverter.com -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Preparing Data for Pivot Table | Excel Discussion (Misc queries) | |||
Please help, Preparing properties automation needed? | Excel Discussion (Misc queries) | |||
Preparing of Phone Directory | Setting up and Configuration of Excel | |||
Reg: Preparing Charts using Pivot Data | Excel Discussion (Misc queries) | |||
Macro preparing numbers to be booked (columns to be chosen conditionally) | Excel Worksheet Functions |