ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if a cell is 0, how do I select a range of cells? (https://www.excelbanter.com/excel-programming/304893-if-cell-0-how-do-i-select-range-cells.html)

Angela0212

if a cell is 0, how do I select a range of cells?
 
I am trying to change an excel spreadsheet into something I can downloa
into our accounting software.
What I am looking for is.......

if H2 is greater than 0, then enter A2:G2 in separate cells, the
enter the H2 amount in the following cell.

I need to do this for up to 5 cells in a column. So if the cell ha
2000 in it... I need the cells to the left to show and the origina
cell amount. But I don't want the amount of the previous cell.

Help!!!

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


Tom Ogilvy

if a cell is 0, how do I select a range of cells?
 
Slow down and try explaining it again. At least in my opinion, this
description is meaningless.

Enter what in A2:G2 and the following cell after G2 is H2????

Five cells in a column - what column? Where do they start.

For five cells, it might be easier for you to do it manually.

--
Regards,
Tom Ogilvy


"Angela0212 " wrote in message
...
I am trying to change an excel spreadsheet into something I can download
into our accounting software.
What I am looking for is.......

if H2 is greater than 0, then enter A2:G2 in separate cells, then
enter the H2 amount in the following cell.

I need to do this for up to 5 cells in a column. So if the cell has
2000 in it... I need the cells to the left to show and the original
cell amount. But I don't want the amount of the previous cell.

Help!!!!


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




Angela0212[_2_]

if a cell is 0, how do I select a range of cells?
 
Okay, let me try again.

I have a spreadsheet. There are 10 columns. I am trying to move onl
parts to a second sheet.
The first 5 columns are mandatory. The next 5 columns may or may no
have a dollar amount in them. So for one row, I could have 5 dolla
amounts for one description (the first 5 columns).
So what I am trying to do is break it down line by line. Say the firs
non mandatory column has $10, what I need is to be able to have th
mandatory codes copy to another sheet along with the dollar amount
Then the second non mandatory column could have a $$ amount in it and
want it to pull the mandatory columns and that dollar amount but no
the first.
Does that make more sense

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


Tom Ogilvy

if a cell is 0, how do I select a range of cells?
 
Much better

As I understand it, for each non empty cell in columns F:J, copy the
corresponding cells in A:E for that row and the value in the nonempty cell
to sheet2 in their own row.

Dim rw as Long, cell as Range, i as Long
rw = 2
for each cell in Range(Range("A2"),Cells(rows.count,1).end(xlup))
for i = 6 to 10
if Not isempty(cells(cell.row,i)) then
cell.Resize(1,5).copy Destination:=worksheets("Sheet2") _
.Cells(rw,1)
cells(cell.row,i).copy Destination:=worksheets("Sheet2") _
.Cells(rw,6)
rw = rw + 1
end if
Next i
Next

--
Regards,
Tom Ogilvy



"Angela0212 " <<Ang
wrote in message
...
Okay, let me try again.

I have a spreadsheet. There are 10 columns. I am trying to move only
parts to a second sheet.
The first 5 columns are mandatory. The next 5 columns may or may not
have a dollar amount in them. So for one row, I could have 5 dollar
amounts for one description (the first 5 columns).
So what I am trying to do is break it down line by line. Say the first
non mandatory column has $10, what I need is to be able to have the
mandatory codes copy to another sheet along with the dollar amount.
Then the second non mandatory column could have a $$ amount in it and I
want it to pull the mandatory columns and that dollar amount but not
the first.
Does that make more sense?


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





All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com