Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default entering data to table

i have a table, 5 fields (columns) for manager name, project name, etc,

and another 144 columns giving money spent for each month
so column headers would be:-
manager name, project name, project code, category, identifier
then months going from jan-05 upwards for 12 years, so table has 149
columns and as many rows as records.


what i need is a method where a user can easily update this table
without having to find the correct row / column themselves.


how can i get a value from a user entry cell into the correct cell in
the table.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default entering data to table

Hi,
What field(s) uniquely identify a row so we know which one to update?
What fields do you want to update - is it (only) money spent? And can new
projects and associated details be added?

If some(/all) of the (first 5) fields have a limited number of values, then
use of comboboxes to select your "search" fields is one approach.

"philcud" wrote:

i have a table, 5 fields (columns) for manager name, project name, etc,

and another 144 columns giving money spent for each month
so column headers would be:-
manager name, project name, project code, category, identifier
then months going from jan-05 upwards for 12 years, so table has 149
columns and as many rows as records.


what i need is a method where a user can easily update this table
without having to find the correct row / column themselves.


how can i get a value from a user entry cell into the correct cell in
the table.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default entering data to table

the first five fields uniquely identify a row, so this plus the month
and year will be the unique id.
i am familiar with the drop down boxes, but how to know which cell to
enter the user entered value?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default entering data to table

Hi again,
I think the only option is to add an extra column at the
beginning (i.e. will be column A) which contains a "key" composed of the 5
identifier fields concatenated together. However, for this (or any other
matching to work), you need to ensure the search field contents match the
data in your file; extra blanks/mistyping will cause mismatches.

You can then do a MATCH to find the row. Having found the row, you can
calculate the column based on a date.

Sample code is shown below. It assumes row 1 is a header row and the
"SearchKey" is composed of the 5 identifier fields.

Function GetRow(ByVal SearchKey As String)
Dim res As Variant
' "Primary_Key" is named range based on Column A
res = Application.Match(SearchKey, Range("Primary_Key"), 0)
If IsError(res) Then
MsgBox SearchKey & " not found"
GetRow = 0
Else
MsgBox SearchKey & " Found in row " & res + 1 ' Allow for header
GetRow = res + 1
End If
End Function


' My test ......

Sub test()

n = 3 ' Test for key in row 3 of test data
' Create a search key (data in columns B to F)
' Replace by Comboboxes ??
SearchKey = ""
For i = 2 To 6
SearchKey = SearchKey & Cells(n, i)
Next i
' Find the row for this key
Keyrow = GetRow(SearchKey)
' InYear/inMonth are year/month where data is to be placed
inYear = 2006
inMonth = 7
' Amount is data to be entered
Amount = 1234.56
' Calculate Column number assuming start of Jan-05 (in Column G)

KeyCol = (inYear - 2005) * 12 + inMonth + 6

Cells(Keyrow, KeyCol).Select ' Select not really rquired
ActiveCell = Amount ' or Cell(KeyRow,KeyCol)=Amount

End Sub

HTH

"philcud" wrote:

the first five fields uniquely identify a row, so this plus the month
and year will be the unique id.
i am familiar with the drop down boxes, but how to know which cell to
enter the user entered value?


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
Entering Days360 in Table formula Bob Arnett Excel Discussion (Misc queries) 2 October 15th 09 09:02 PM
Validation Table - Entering Value not in a table saltnsnails Excel Discussion (Misc queries) 2 August 21st 08 07:54 PM
transfering data in another column entering more sorted data Kevin - Corporate Services Excel Worksheet Functions 0 August 6th 08 09:23 PM
Entering Variable in a Pivot Table flyer27 Excel Discussion (Misc queries) 0 March 13th 07 03:05 PM
entering data to table philc Excel Worksheet Functions 3 May 26th 05 07:55 PM


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