View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
J_J[_2_] J_J[_2_] is offline
external usenet poster
 
Posts: 140
Default can such a VBA code made?

Bob, the original file that I am working on is not mine. There are buttons
on the left of the page with + or - signs on them. When pressed the rows
that are not visible becomes visible/hidden. With cells on the visible
yellow area, the user tries to sum-up all the data above each column (which
in normal are not visible because of the buttons mode).
J_J

"Bob Phillips" wrote in message
...
I hid a column (FormatColumnHide), and that worked for me. How have you
set yours to not visible?
Did you also catch the NG wrap-around?
--

HTH

RP
(remove nothere from the email address if mailing direct)


"J_J" wrote in message
...
Thank you Sharad and Bob,
But unfortunately both codes didn'y worked for me !.
Could it be because the above cells are not visible on the screen?.


"Bob Phillips" wrote in message
...
Here is one way

Sub testcells()
Dim cell As Range

For Each cell In Selection
If cell.Interior.ColorIndex = 6 Then
If cell.Column = 1 Then
MsgBox "Can't get a previous in cell " &

cell.Address(False,
False)
Else
cell.Value = cell.Offset(0, -1).Value
End If
End If
Next cell

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"J_J" wrote in message
...
So sorry about my mistake with the question!

The correct Q. should have been:
"I have a worksheet with some data on it. Some cells are colored
with green, yellow or red. I need a macro code that when executed
(assigned
to a button) will check for cells which are filled with "yellow"

color
and assign values to thouse cells in such a way that:
each of these cells will be filled with the values above these

cells!
(e.g.
say cell
C12, K22 and N55 are colored yellow, then C12 will display the

value
of cell C11; cell K22 will display the value of cell K21 and cell

N55
will
display the value in cell N54).
Is such an event possible?. Can anyone set an example?"
TIA
J_J



"J_J" wrote in message
...
Hi,
I have a worksheet with some data on it. Some region of cells are
colored
with green, yellow or red. I need a macro code that when executed
(assigned
to a button) will check for cells that are filled with "yellow"

color
only
and assign values to thouse cells in such a way that:
each of these cells will be filled with the value before it! (e.g.

say
cell
C12, K22 and N55 are colored yellow, then C12 will be filled with

the
value
of cell C11; cell K22 will get the value of cell K21 and N55 will

get
N54).
Is such an event possible?. Can anyone set an example?
Thanks in advance
J_J