Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Mirroring an offset

Hi, sorry if this a simple one, but I'm not thinking very clearly today. I
have a range of cells to model a theatre seating plan; using the
worksheet_selectionChange, the seats are selected and the seats/cells are
coloured.

I have another range similar to the seating plan, one column to the right of
the seating plan, when the seats are selected, I want the cells on the right
side to be filled with a booking value(name obtained through a user form text
box). How do I programmatically work out the horizontal offset with the
current target cell address?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3
BookingRange=Target.cells.address
fmBooking.Show
BookingRef=Booking.text

---Here I'm stuck---
New range.offset.value = BookingRef

End Sub

Many thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Mirroring an offset

Hi Wendy,

Not sure if I understand correctly, but I think this will do it,
assuming you want the name one cell to the right of the booking range.
Note that I have changed Target to ActiveCell. Target will give you an
entire range, ActiveCell just gives you the single active cell which I
am assuming is what you are after. The danger with Target in this case
would be that if someone accidentally selected more than one cell, all
cells selected will be coloured.

Dim BookingRef As String, BookingRange As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveCell.Interior.ColorIndex = 3
Set BookingRange = ActiveCell
fmBooking.Show
BookingRef = Booking.Text

BookingRange.Offset(0, 1) = BookingRef
End Sub

Cheers,
Ivan.

On Apr 1, 11:06*am, Wendy wrote:
Hi, sorry if this a simple one, but I'm not thinking very clearly today. I
have a range of cells to model a theatre seating plan; using the
worksheet_selectionChange, the seats are selected and the seats/cells are
coloured.

I have another range similar to the seating plan, one column to the right of
the seating plan, when the seats are selected, I want the cells on the right
side to be filled with a booking value(name obtained through a user form text
box). How do I programmatically work out the horizontal offset with the
current target cell address?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3
BookingRange=Target.cells.address
fmBooking.Show
BookingRef=Booking.text

---Here I'm stuck---
New range.offset.value = BookingRef

End Sub

Many thanks for your help.


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
A Mirroring Spreadsheet... J Ray Excel Worksheet Functions 4 August 12th 09 03:01 PM
Mirroring worksheets AKphidelt Excel Programming 1 June 28th 07 04:08 PM
mirroring worksheets Natalie Excel Worksheet Functions 4 June 28th 07 12:23 AM
Linking or Mirroring workbook michael Excel Worksheet Functions 0 May 24th 07 06:57 PM
Mirroring cells careyc Excel Discussion (Misc queries) 5 October 17th 05 03:49 PM


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