LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Applying a macro to a range of cells

Hi,

I've written a macro which creates URLs from part numbers in the active
cell using a part number in the cell immediately left. However it only
works if I select a single cell. As soon as I select multiple cells, the
macro seems to have no effect.

Can somebody please tell me how I modify it so it works if I select an
entire column:

Sub Macro2()
Dim leftCellValue
leftCellValue = ActiveCell.Offset(0, -1).Value
If Left(leftCellValue, 2) = "92" Then

ActiveCell.Hyperlinks.Add Anchor:=Selection,
Address:="http://website/product.aspx?part=" & ActiveCell.Offset(0,
-1).Value
ActiveCell.Value = "view"
End If
End Sub

Thanks,

Nick....
 
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
applying math operation across range of cells yb Excel Programming 3 May 20th 06 07:04 AM
Applying vlookup to a range Shal Excel Programming 4 April 5th 06 09:59 AM
applying a macro for a specific field to a range of fields Craig[_24_] Excel Programming 3 October 12th 05 05:27 AM
Applying formula to only NON-EMPTY cells in range Tasi Excel Discussion (Misc queries) 5 March 29th 05 10:48 PM


All times are GMT +1. The time now is 09:42 AM.

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"