Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
i have already have something written out to subtract cells fro
eachother in a row until it hits a neg. number. then it stops on tha last pos number. i want to have the number left over from th subtractions to be added at the end of the row in the first emtp cell. so if a1 - b1 - c2 = 23 i want 23 in the first empty cell in that row and so it will do it for each row. i have the subtraction part down just need something to tell it to add whats left over into the firs emtpy cell on the row. if any info needed just reply. thank -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
try
Sub sumrow() mr = ActiveCell.Row x = Cells(mr, Columns.Count).End(xlToLeft).Column + 1 Cells(mr, x) = Application.Sum(Range(Cells(mr, "a"), Cells(mr, x - 1))) End Sub -- Don Guillett SalesAid Software "derekc " wrote in message ... i have already have something written out to subtract cells from eachother in a row until it hits a neg. number. then it stops on that last pos number. i want to have the number left over from the subtractions to be added at the end of the row in the first emtpy cell. so if a1 - b1 - c2 = 23 i want 23 in the first empty cell in that row, and so it will do it for each row. i have the subtraction part down, just need something to tell it to add whats left over into the first emtpy cell on the row. if any info needed just reply. thanks --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
Derek,
Assuming that you have the value in variable myVal Range("A1").Offset(0,Cells(1,Columns.Count).End(xl ToLeft).Column).Value = myVal and so on for the other rows -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "derekc " wrote in message ... i have already have something written out to subtract cells from eachother in a row until it hits a neg. number. then it stops on that last pos number. i want to have the number left over from the subtractions to be added at the end of the row in the first emtpy cell. so if a1 - b1 - c2 = 23 i want 23 in the first empty cell in that row, and so it will do it for each row. i have the subtraction part down, just need something to tell it to add whats left over into the first emtpy cell on the row. if any info needed just reply. thanks --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
tried don's way and it gave me a zero for first row and that was it. an
0 wasnt right either and i dont have myVal. this is what i have s far. Private Sub launchbutton_1_Click() lastRow = Worksheets("First Sheet").UsedRange.Row - 1 Worksheets("First Sheet").UsedRange.Rows.Count lastCol = Worksheets("First Sheet").UsedRange.Column - 1 Worksheets("First Sheet").UsedRange.Columns.Count With Worksheets("First Sheet") For x = 2 To lastRow On Error GoTo Skip y = 7 runTot = 0 parts = .Cells(x, 7).Value Do Until y = lastCol _ Or runTot parts y = y + 1 runTot = runTot + .Cells(x, y).Value Loop If runTot parts Then For z = 8 To y - 1 .Cells(x, z).Interior.ColorIndex = 6 Next z ElseIf y = lastCol Then For z = 8 To y If .Cells(x, z).Value < "" Then .Cells(x, z).Interior.ColorIndex = 6 End If Next z End If Skip: Next x End With End Su -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
|
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
insert amount into first emtpy cell
See my response to your May 18 post.
Regards, Greg -----Original Message----- i have already have something written out to subtract cells from eachother in a row until it hits a neg. number. then it stops on that last pos number. i want to have the number left over from the subtractions to be added at the end of the row in the first emtpy cell. so if a1 - b1 - c2 = 23 i want 23 in the first empty cell in that row, and so it will do it for each row. i have the subtraction part down, just need something to tell it to add whats left over into the first emtpy cell on the row. if any info needed just reply. thanks --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Active Hide Emtpy Cells | Excel Discussion (Misc queries) | |||
Insert Row When Column Amount Changes | Excel Discussion (Misc queries) | |||
Insert Row When Column Amount Changes | New Users to Excel | |||
Insert New Row When Column Amount Changes | Excel Worksheet Functions | |||
Hide row when cell is emtpy | Excel Programming |