#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default To my left...

How might I refer to and return a value of a cell just one over left
from my current cell range?

For Each Cell In rngRange
Cell.Select

If Selection.Value < "" Then
On Error Resume Next
Sh.Pictures.Insert(Selection.Value).Select
Selection.ShapeRange.ScaleWidth 0.47, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.47, msoFalse,
msoScaleFromTopLeft

Else
Exit Function
End If

Next Cell

Unfortunately this code continues down the spreasheet indefinately. I
need to Exit the For if the value of one cell left of Selection is = ""

Any help would be greatly appreciated. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default To my left...

For Each cell In rngRange
If cell.Offset(0, -1).Value < "" Then
On Error Resume Next
With Sh.Pictures.Insert(cell.Value)
.ShapeRange.ScaleWidth 0.47, msoFalse, msoScaleFromTopLeft
.ShapeRange.ScaleHeight 0.47, msoFalse, msoScaleFromTopLeft
End With
Else
Exit Function
End If

Next cell



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zamdrist" wrote in message
ups.com...
How might I refer to and return a value of a cell just one over left
from my current cell range?

For Each Cell In rngRange
Cell.Select

If Selection.Value < "" Then
On Error Resume Next
Sh.Pictures.Insert(Selection.Value).Select
Selection.ShapeRange.ScaleWidth 0.47, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.47, msoFalse,
msoScaleFromTopLeft

Else
Exit Function
End If

Next Cell

Unfortunately this code continues down the spreasheet indefinately. I
need to Exit the For if the value of one cell left of Selection is = ""

Any help would be greatly appreciated. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default To my left...

Thank you Bob

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
Excel should calculate exponentials properly (right to left) expatrie Excel Worksheet Functions 5 April 26th 06 08:34 AM
How do I sum numbers in rolling format? (4 qtrs=4 cells to left) Deb Excel Discussion (Misc queries) 2 April 19th 06 04:46 PM
Find text within cell then display text to left Jambruins Excel Discussion (Misc queries) 5 April 17th 06 10:01 PM
Scrollbar on Chart Jumps to Left when Chart is Clicked Bob Charts and Charting in Excel 5 May 1st 05 02:06 AM
The left function does not work when displaying times, how is thi. Nambo27 Excel Worksheet Functions 3 February 25th 05 06:46 PM


All times are GMT +1. The time now is 07:37 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"