LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Macro relative to button position

Excellent - Resize(1, 5).Value sets all the cells at once! I had expected it
would only set the first cell. Learn something new every day... :)


"Tom Ogilvy" wrote in message
...
Public Sub Button_Click()
With ActiveSheet.Buttons(Application.Caller)
With Cells(.TopLeftCell.Row, .BottomRightCell.Column + 1)
.Resize(1,5).Value = "X"
End With
End With
End Sub

Was more what I had in mind.

--
Regards,
Tom Ogilvy

Rob van Gelder wrote in message
...
Public Sub Button_Click()
With ActiveSheet.Buttons(Application.Caller)
With Cells(.TopLeftCell.Row, .BottomRightCell.Column + 1)
.Value = "X"
.AutoFill .Resize(1, 5), xlFillCopy
End With
End With
End Sub


"wesandem " wrote in message
...
Thanks for the help guys - looks like it's working perfectly now. One
more thing I should have asked earlier - what would I change if I want
this action to apply to not just the adjacent cell but to the next

five
cells?


---
Message posted from http://www.ExcelForum.com/







 
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
How to macro to relative position jk9533 Excel Discussion (Misc queries) 6 October 15th 07 08:11 PM
Relative position of Employees Bob Davison Excel Worksheet Functions 9 May 8th 07 07:23 PM
Recording new excel macro, relative reference button doesn't show Dano New Users to Excel 3 August 23rd 05 07:36 PM
Relative Cell position NOT working with or without macro Scratching my Head Excel Discussion (Misc queries) 6 May 30th 05 06:12 PM
relative position in macro pabs[_10_] Excel Programming 4 January 3rd 04 06:25 AM


All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"