Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA: Add cell value to another worksheet cell using Find and offset

Hi All,

I have a workbook containing the accounting for my scout group.

It contains a AnnualReport sheet and a report sheet for each month.

I want the AnnualReport to update automaticly based on each months
report.

I created a button, so that when I finished a monts report (and
verified everything ok) it updates the AnnualReport.

What I'm trying to do in a vba code (assigned to the button) is the
following:
1) look for value in cell B5 of month report (where code is located) -
That contains the expense categorie
2) Look for that value in cells A1 to A50 of sheet AnnualReport
3) Update the value of the cell to the right (offset (1.0)) adding the
value of D5 of months report
4) repeat the operation with the next 10 rows (ie B6 to B15)

I'm kinda lost, everithing I tryied gets me errors.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Add cell value to another worksheet cell using Find and offset

if the layout of all the reports is identical you could do this

in B5 of the annual report put in

=sum(Jan:Dec!B5)

then you could drag fill this formula down and across. I assume the monthly
sheets are named Jan, Feb, etc. and they are all together in the tab order
with the first sheet being Jan and the last sheet being Dec.

--
Regards,
Tom Ogilvy

"Caméléon" wrote in message
oups.com...
Hi All,

I have a workbook containing the accounting for my scout group.

It contains a AnnualReport sheet and a report sheet for each month.

I want the AnnualReport to update automaticly based on each months
report.

I created a button, so that when I finished a monts report (and
verified everything ok) it updates the AnnualReport.

What I'm trying to do in a vba code (assigned to the button) is the
following:
1) look for value in cell B5 of month report (where code is located) -
That contains the expense categorie
2) Look for that value in cells A1 to A50 of sheet AnnualReport
3) Update the value of the cell to the right (offset (1.0)) adding the
value of D5 of months report
4) repeat the operation with the next 10 rows (ie B6 to B15)

I'm kinda lost, everithing I tryied gets me errors.

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default VBA: Add cell value to another worksheet cell using Find and offse

Option Explicit

Sub UpdateAnnualReport()
Dim oCell As Range
Dim Dest As Range

For Each oCell In ActiveSheet.Range("B5:B15")
Set Dest =
Sheets("AnnualReport").Range("A1:A50").Find(What:= oCell).Offset(0, 1)
Dest = Dest + oCell.Offset(0, 2)
Next oCell

End Sub


"Caméléon" wrote:

Hi All,

I have a workbook containing the accounting for my scout group.

It contains a AnnualReport sheet and a report sheet for each month.

I want the AnnualReport to update automaticly based on each months
report.

I created a button, so that when I finished a monts report (and
verified everything ok) it updates the AnnualReport.

What I'm trying to do in a vba code (assigned to the button) is the
following:
1) look for value in cell B5 of month report (where code is located) -
That contains the expense categorie
2) Look for that value in cells A1 to A50 of sheet AnnualReport
3) Update the value of the cell to the right (offset (1.0)) adding the
value of D5 of months report
4) repeat the operation with the next 10 rows (ie B6 to B15)

I'm kinda lost, everithing I tryied gets me errors.

Thanks in advance.


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
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Worksheet Functions 2 September 28th 07 10:54 PM
Need find cell b3 value on another worksheet! StarGazer Excel Worksheet Functions 3 October 31st 04 03:19 PM
Need find cell b3 value on another worksheet! StarGazer Excel Worksheet Functions 1 October 28th 04 08:35 AM
Need find cell b3 on another worksheet! StarGazer Excel Programming 1 October 28th 04 07:20 AM
Need find cell b3 value on another worksheet! StarGazer Excel Worksheet Functions 1 October 28th 04 07:09 AM


All times are GMT +1. The time now is 12:35 AM.

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

About Us

"It's about Microsoft Excel"