MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Mar 30th, 2004, 05:24 AM   #1
SlinkRN
 
SlinkRN's Avatar
 
Join Date: Oct 2002
Location: Illinois
Posts: 543
Default Assigning range passwords using a macro

Hi! I want to assign a range password (using Excel XP) to each range to the right of a list of names. I want to do it with a macro so that each range's password is the actual name. The code to assign a range password is something like this:

dim strName as string
strName = activecell
Range("B10:J10").select
activesheet.protection.allowEditRanges.Add Title:="Range1", Range:= _
Range("B10:J10"), Password:=strName

Can I do this in some sort of loop that will go through the whole list and assign each name as the password for that range? I have a worksheet example but I can't figure out how to post it using Colo's HTML download. It works on my screen, but I can't figure out how to get it to show up in this post

Anyway, the list of names is in column A starting in row 10.
Can anyone help?
SlinkRN is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 02:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.