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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/



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
Select range of cells from A1 to last cell with data? Bob Arnett Excel Discussion (Misc queries) 8 September 25th 09 04:31 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
how can I select a range of cells based on a value of a cell? grigoras victor Excel Discussion (Misc queries) 1 June 26th 06 04:55 PM
using cell values to select range of cells Ray[_9_] Excel Programming 4 October 10th 03 08:31 AM


All times are GMT +1. The time now is 08:40 PM.

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"