Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default insert amount into first emtpy cell

bump


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default 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
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
Active Hide Emtpy Cells Asian Mike Excel Discussion (Misc queries) 1 January 31st 06 03:56 PM
Insert Row When Column Amount Changes Ronald \Tony\ Johnson Excel Discussion (Misc queries) 2 May 5th 05 12:37 PM
Insert Row When Column Amount Changes Ronald \Tony\ Johnson New Users to Excel 1 May 4th 05 01:58 PM
Insert New Row When Column Amount Changes Ronald \Tony\ Johnson Excel Worksheet Functions 1 May 4th 05 01:15 PM
Hide row when cell is emtpy Hannes Heckner Excel Programming 2 March 5th 04 09:48 AM


All times are GMT +1. The time now is 11:39 AM.

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

About Us

"It's about Microsoft Excel"