Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Inputting a value into a range of cells
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 1st June 11:46
peter rooney=^(읊.Ȩɢr,\
External User
 
Posts: 1
Default Inputting a value into a range of cells



Jack gave me a useful tip (see "Problems with filtered data") as to how I
should best filter my plan to show activities carried out by a certain team
(add a field and enter the team name into it for filtering purposes). So now,
I want to go down my plan and input the name of the team into the new text
field. I obviously don't want to type it in manually each time - rather, for
my new field, I want to select arange or tasks, then input a new value into
each "cell" (incidentally, what is the correct terminology?) in my selection.

i KNOW I should learn my object hierarchy more thoroughly but I have to set
my objectives to the end of the year today (new job - only been here three
weeks) and one of them is managing this plan - this is about the last thing I
need to do urgently, before I can give myself the luxury of actually learning
Project VBA!

Sorry to bring my life history onto the board, but you wouldn't want to see
me chucked out, would you..?

Heres the code I started with.

Sub AllTeam()
For Each InputField In ActiveSelection.Tasks
SetInputField Field:="Text5", Value:="Software Mgt"
Next
End Sub

This inputs the value into the first cell in the selction, but not the rest.

Thanks in advance

Pete
  Reply With Quote


  sponsored links


2 1st June 11:46
rod gill
External User
 
Posts: 1
Default Inputting a value into a range of cells



Hi,

If this is a one off job then enter the value in one cell, then hold the
Ctrl key down and select cells below that will have the same value. Ctrl+D
will fill down. In Proejct Fill Down works on individual cells, they don't
have to be contiguous like in Excel.

Otherwise:
Sub AllTeam()
Dim T as Task
For Each T In ActiveSelection.Tasks
T.Text5:="Software Mgt"
Next
End Sub


--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit http://www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
  Reply With Quote
3 1st June 11:46
peter rooney=^(읊.Ȩɢr,\
External User
 
Posts: 1
Default Inputting a value into a range of cells


Hi, Rod,

Both of these solutions were handy in filling in different types of entry,
plus you solved another of my object model queries.

Thank you VERY much!

Pete
  Reply With Quote
4 1st June 11:47
jackd
External User
 
Posts: 1
Default Inputting a value into a range of cells


Peter,

I recommend that you take a look at my site

http://masamiki.com/project/macros.htm

and work through each of the code samples. They illustrate most of the basic
things you will want to do with the object model.
Most are pretty simple. If you can understand all the statements in them,
then you can consider yourself to have a basic understanding of how Project
VBA works and what can be done with it. From there you can start digging
into the object model for more.

--
-Jack ... For project information and macro examples visit
http://masamiki.com/project

..
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666