Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Two Cells on Two Different Worksheets


Hi All,

I'm new to this board and new to VBA. If you could point me in th
right direction, it would be much appreciated.

I'm trying to compare two cells on two different worksheets and addin
values into a column on one of the sheets.

Data is set up as follows:

WS #1 Invoices
A1: Acct# B1: ShipToCode C1: InvoiceAmt

WS#2 Accounts
A1: Acct# B1: ShipToCode C1: NewSalesTotal

I'm trying to match Acct#/ShipToCode and then add the InvoiceAmt t
NewSalesTotal.

I'm good at cut/paste and modifying the code to my needs but am havin
problems finding something similar to this.

Thanks in advance,
Christin

--
weeshie7
-----------------------------------------------------------------------
weeshie73's Profile: http://www.excelforum.com/member.php...fo&userid=2479
View this thread: http://www.excelforum.com/showthread.php?threadid=38354

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Comparing Two Cells on Two Different Worksheets

You can probably do this without resorting to code but we need a little more
information. Let me know if I am wrong anywehere here. On sheet 1 and 2 you
have Account codes and Ship to Codes. The idea is to match up the Codes and
create a sum of the matching items. Do the all of the Account Codes and ship
to codes exist on at least one of the sheets. That is to say could at least
one of the sheets be considered a master list of all Account codes and Ship
to codes or do we have to create a new sheet that will be a master list of
all codes. It makes a difference in terms of the final solution I would
recommend.

--
HTH...

Jim Thomlinson


"weeshie73" wrote:


Hi All,

I'm new to this board and new to VBA. If you could point me in the
right direction, it would be much appreciated.

I'm trying to compare two cells on two different worksheets and adding
values into a column on one of the sheets.

Data is set up as follows:

WS #1 Invoices
A1: Acct# B1: ShipToCode C1: InvoiceAmt

WS#2 Accounts
A1: Acct# B1: ShipToCode C1: NewSalesTotal

I'm trying to match Acct#/ShipToCode and then add the InvoiceAmt to
NewSalesTotal.

I'm good at cut/paste and modifying the code to my needs but am having
problems finding something similar to this.

Thanks in advance,
Christine


--
weeshie73
------------------------------------------------------------------------
weeshie73's Profile: http://www.excelforum.com/member.php...o&userid=24792
View this thread: http://www.excelforum.com/showthread...hreadid=383548


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Two Cells on Two Different Worksheets


Jim,

You have my concept correct. WS#2 Accounts would be considered
master list. No new sheet is needed.

Thanks!
Christin

--
weeshie7
-----------------------------------------------------------------------
weeshie73's Profile: http://www.excelforum.com/member.php...fo&userid=2479
View this thread: http://www.excelforum.com/showthread.php?threadid=38354

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Comparing Two Cells on Two Different Worksheets

On sheet 2 (your master sheet) add this formula anywhere on Row 2.

=SUMPRODUCT((A2=Sheet1!$A$2:$A$65536)*(B2=Sheet1!$ B$2:$B$65536)*Sheet1!$C$2:$C$65536)

This formula will find all instances on Sheet 1 where the Account code and
the Ship To Code match with the Account code and ship to Code of the line you
are on. It will sum the values in Column C of those matching records. If you
need more info on sumproduct check out this link.

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
HTH...

Jim Thomlinson


"weeshie73" wrote:


Jim,

You have my concept correct. WS#2 Accounts would be considered a
master list. No new sheet is needed.

Thanks!
Christine


--
weeshie73
------------------------------------------------------------------------
weeshie73's Profile: http://www.excelforum.com/member.php...o&userid=24792
View this thread: http://www.excelforum.com/showthread...hreadid=383548


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Two Cells on Two Different Worksheets


Thanks so much! Worked beautifully

--
weeshie7
-----------------------------------------------------------------------
weeshie73's Profile: http://www.excelforum.com/member.php...fo&userid=2479
View this thread: http://www.excelforum.com/showthread.php?threadid=38354

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
comparing from two worksheets Lorne Excel Discussion (Misc queries) 4 May 11th 08 06:19 PM
Comparing two worksheets Sasikiran Excel Discussion (Misc queries) 2 September 26th 07 04:46 PM
Comparing two different Worksheets senthilmca Excel Worksheet Functions 0 June 1st 06 06:36 AM
Comparing Two Worksheets for changes Jugglertwo Excel Discussion (Misc queries) 1 December 7th 05 08:56 PM
Comparing two worksheets Dennis Excel Programming 1 November 14th 03 08:08 PM


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