View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stainless stainless is offline
external usenet poster
 
Posts: 18
Default VBA get range from cell offset

I have a macro that allows pictures to be added to a cell defined as a
range and, as such, takes the range as an input i.e.

Sub InsertPicture(PictureFileName As String, TargetCell As Range, _
CenterH As Boolean, CenterV As Boolean)

However, my main code is using cell offsets in all of the processing
and I am unsure as to how to convert my offset cell to the TargetCell
value required above i.e.

Set fdcCell = FDCs.Cells(fdcrownumber, 1) -- the initial cell
definition

The cell I need to find the range value for is fdcCell.Offset(0, 18)

I guess I have to create a range variable such as "Dim pictRange As
Range"

What is the command to set this pictRange value to that of the cell
defined by offset fdcCell.Offset(0, 18) ??

Cannot get this right!!

Cheers