Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Michael A
 
Posts: n/a
Default vb help, convert from formula to vb code..

Hello,

I am trying to get this formula to work.. and Im not sure where to go from
here. Could someone please help? Thanks in advance, this community has been
very great.

Im trying to convert this excel formula to a vb formula:
=SUMPRODUCT(--(B1:B3000=DATE(2006,1,6)),--(ISNUMBER(FIND("cxl",H1:H3000))))

I need it to count how many times it finds "CXL" in the H column when the B
column matches up with the user input.

code:

Sub MAM()
Dim nStuff As String
Dim ThisSheet As String
Dim j As Long

ThisSheet = ActiveSheet.Name

nStuff = InputBox _
("What date is this for? I.E 1/1/2006,1/5/2006 etc.")

Application.ScreenUpdating = False
Workbooks.Open Filename:="\\server1\sharedfile\mam2006.xls"

With Worksheets("Jan 06")
'Now working in the MAM Sheet
j = Application.SumProduct(--(.Columns(2) = nStuff),
--(IsNumber(Find("cxl", .Columns(8)))))

End With

Workbooks("January.xls"). _
Worksheets(ThisSheet).Range("B45").Value = j

ActiveWorkbook.Close False
Application.ScreenUpdating = True

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default vb help, convert from formula to vb code..

See response in other thread. Don't just fire off new threads, it is not
good etiquette and wastes people's time.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Michael A" wrote in message
...
Hello,

I am trying to get this formula to work.. and Im not sure where to go from
here. Could someone please help? Thanks in advance, this community has

been
very great.

Im trying to convert this excel formula to a vb formula:

=SUMPRODUCT(--(B1:B3000=DATE(2006,1,6)),--(ISNUMBER(FIND("cxl",H1:H3000))))

I need it to count how many times it finds "CXL" in the H column when the

B
column matches up with the user input.

code:

Sub MAM()
Dim nStuff As String
Dim ThisSheet As String
Dim j As Long

ThisSheet = ActiveSheet.Name

nStuff = InputBox _
("What date is this for? I.E 1/1/2006,1/5/2006 etc.")

Application.ScreenUpdating = False
Workbooks.Open Filename:="\\server1\sharedfile\mam2006.xls"

With Worksheets("Jan 06")
'Now working in the MAM Sheet
j = Application.SumProduct(--(.Columns(2) = nStuff),
--(IsNumber(Find("cxl", .Columns(8)))))

End With

Workbooks("January.xls"). _
Worksheets(ThisSheet).Range("B45").Value = j

ActiveWorkbook.Close False
Application.ScreenUpdating = True

End Sub




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
Complicated If Then / V Lookup / Match Statement... ryesworld Excel Worksheet Functions 17 December 10th 05 03:09 PM
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 01:29 PM
Excel hard code those #'s without deleting the formula or typing# JudiS Excel Discussion (Misc queries) 1 August 2nd 05 12:21 AM
How to create formula to convert? ynot Excel Worksheet Functions 9 July 11th 05 07:07 PM
convert equation to formula DW in SF Excel Discussion (Misc queries) 3 May 27th 05 06:55 AM


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