Google
 
Web ppczone.net

View Full Version : SpreadCE Macro Help


sefba
08-07-2006, 04:07 PM
Hello All,

Is there anyone here knows a web site that has some macro sample's for
SpreadCE??? (other than the help files comming with the program)

Any ways, i have been working on macros in spread sheets for 2-3 day,
however i couldn able to find a answer. I have created a xls document
in MS Excel that has a small peice of VBA code included which is like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

For i = 1 To 114
If Cells(11 + i, 3).Value <> "" And Cells(11 + i, 4).Value = "" Then
Cells(11 + i, 4).Value = Cells(10 + i, 4).Value
End If
Next i

End Sub

This loop executes every time user inserts a new value to the sheet.
can anyone help me to convert this code to Spread Style?... To be
honest, i only need a similiar function to CELL in VBA... (tried
ADDRESS in spread sheet but it only returns the value in STring format)

Stephen Bye
08-07-2006, 05:16 PM
"sefba" <sefaokumus@gmail.com> wrote in message
news:1154981225.782548.129260@m73g2000cwd.googlegr oups.com...
> Hello All,
>
> Is there anyone here knows a web site that has some macro sample's for
> SpreadCE??? (other than the help files comming with the program)
>
> Any ways, i have been working on macros in spread sheets for 2-3 day,
> however i couldn able to find a answer. I have created a xls document
> in MS Excel that has a small peice of VBA code included which is like
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>
> For i = 1 To 114
> If Cells(11 + i, 3).Value <> "" And Cells(11 + i, 4).Value = "" Then
> Cells(11 + i, 4).Value = Cells(10 + i, 4).Value
> End If
> Next i
>
> End Sub
>
> This loop executes every time user inserts a new value to the sheet.
> can anyone help me to convert this code to Spread Style?... To be
> honest, i only need a similiar function to CELL in VBA... (tried
> ADDRESS in spread sheet but it only returns the value in STring format)
>

Translating your subroutine into English, it seems to be:
"For each cell from D12 to D125, if the cell is empty and the cell to the
left is not empty then copy into this cell the value of the cell above"

In SpreadCE you would do this with the following 2 macros entered on a macro
sheet.
The first macro is the target of the Auto_Open defined name and it registers
the name of the second macro to be run on a sheet change event.
The second macro processes the cells in the range as described above.

auto open macro: =ON.ENTRY("[copytest.xls]Sheet1","copydown")
=RETURN()

copy down macro: =FOR.CELL("current",!D12:D125)
=IF(AND(OFFSET(current,0,-1)<>"",current=""))
=FORMULA(OFFSET(current,-1,0),current)
=END.IF()
=NEXT()
=RETURN()

Please let me know if you would like me to send you a sample file containing
this by e-mail.

sefba
08-08-2006, 03:33 AM
Thanks alot, but i still couldn't make it, i will email you the files.
Thanks in case
Stephen Bye yazdi:

> Translating your subroutine into English, it seems to be:
> "For each cell from D12 to D125, if the cell is empty and the cell to the
> left is not empty then copy into this cell the value of the cell above"
>
> In SpreadCE you would do this with the following 2 macros entered on a macro
> sheet.
> The first macro is the target of the Auto_Open defined name and it registers
> the name of the second macro to be run on a sheet change event.
> The second macro processes the cells in the range as described above.
>
> auto open macro: =ON.ENTRY("[copytest.xls]Sheet1","copydown")
> =RETURN()
>
> copy down macro: =FOR.CELL("current",!D12:D125)
> =IF(AND(OFFSET(current,0,-1)<>"",current=""))
> =FORMULA(OFFSET(current,-1,0),current)
> =END.IF()
> =NEXT()
> =RETURN()
>
> Please let me know if you would like me to send you a sample file containing
> this by e-mail.

sefba
08-08-2006, 05:47 AM
I worked on it, the second macro works perfectly when i insert a
command button pointing to "countdown" (defined name for
Macro1!$B$4). However, it does'n work automaticly when i enter a new
value. Is there smt else that i have to do for 1st macro

Note: i already defined the Macro1!$B$4 as countdown

sefba
08-08-2006, 05:49 AM
I worked on it, the second macro works perfectly when i insert a
command button pointing to "copydown" (defined name for
Macro1!$B$4). However, it does'n work automaticly when i enter a new
value. Is there smt else that i have to do for 1st macro

Note: i already defined the Macro1!$B$4 as copydown