Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Scripting Error

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Scripting Error

Check one of your other posts.

Jane Doe wrote:

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Scripting Error

I did and no answer. Unless you're seeing something I'm not?

"Dave Peterson" wrote:

Check one of your other posts.

Jane Doe wrote:

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Scripting Error

You found the other post and responded. I answered there with another
suggestion.

It becomes a real pain--for both you and potential responders when you post the
same question multiple times.

You have to check all your threads. And responders may waste their time by
posting when you have an answer elsewhere.

On top of that, lots of people ignore messages that are multiposted like this.

Jane Doe wrote:

I did and no answer. Unless you're seeing something I'm not?

"Dave Peterson" wrote:

Check one of your other posts.

Jane Doe wrote:

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Scripting Error

And Joel posted the typo fix in one of the other threads.

Dave Peterson wrote:

You found the other post and responded. I answered there with another
suggestion.

It becomes a real pain--for both you and potential responders when you post the
same question multiple times.

You have to check all your threads. And responders may waste their time by
posting when you have an answer elsewhere.

On top of that, lots of people ignore messages that are multiposted like this.

Jane Doe wrote:

I did and no answer. Unless you're seeing something I'm not?

"Dave Peterson" wrote:

Check one of your other posts.

Jane Doe wrote:

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Scripting Error

I haven't found that post yet, but you're right. I guess I got a little
desperate for help.

My husband used to help me with VB, but passed away this May. My job
depends on this project...sorry for the desperation. I will be more careful
not to double post.

On the other hand, one of the posts was a separate question. When I get
notification that a reply has come I click on link and it brings up blank
page. At first the first post I could not relocate. Thanks for the advice.


"Dave Peterson" wrote:

And Joel posted the typo fix in one of the other threads.

Dave Peterson wrote:

You found the other post and responded. I answered there with another
suggestion.

It becomes a real pain--for both you and potential responders when you post the
same question multiple times.

You have to check all your threads. And responders may waste their time by
posting when you have an answer elsewhere.

On top of that, lots of people ignore messages that are multiposted like this.

Jane Doe wrote:

I did and no answer. Unless you're seeing something I'm not?

"Dave Peterson" wrote:

Check one of your other posts.

Jane Doe wrote:

Can anyone else help with this have a deadline. Thanks!

I received a Runtime 13 type "mismatch error" ???

Sub CreateaMain()

ShtNames = Array("May 08_478156199", "May 08_4614445456", "June
08_478156199", "June 08_461445456", "July 08_478156199", "July 08_461445456")
With Sheets("Phones_Analysis_9-2008")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Joel" wrote:

I made a slight change in the code to handle a vairable amount of sheets

You can place as many sheet names as required into the line below.
ShtNames = Array("may_acct1", "may_acct2", "may_acct3")

All you need to do is to modify the line above putting in the number of
sheets you want to search. The first sheet results will go into column B,
the next in column C up to the number of sheets you put into the array
statement.

You also need to make sure the Main sheet name is corect in the statment
below. You can change the name in this line to match the summary sheet name

With Sheets("Main")


----------------------------------------------------------
Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = LBound(ShtNames) To UBound(ShtNames)
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub


------------------------------------------------------------------------------------------

"Jane Doe" wrote:

Joel:

I appreciate the help, but this is not clear to me. I am not much good with
excel scripting. Can you explain in more detail where I need to change to
fit my worksheets (i.e. "For ShtNum = 0 to 2 do i need to change to my sheet
names I will be searching? may 08_acct1, june 08_acct2, may 08_acct2, june
08_acct3, etc...

Thank you!

"Joel" wrote:

Try this code

Sub CreateaMain()

ShtNames = Array("may_acct1", "may_acct2", "may_acct3")
With Sheets("Main")
LastRow = .Range("F" & Rows.Count).End(xlUp).Row
For ShtNum = 0 To 2
Set Sht = Sheets(ShtNames(ShtNum))
For RowCount = 1 To LastRow
PhoneNum = .Range("F" & RowCount)
Set c = Sht.Columns("A").Find(what:=PhoneNum, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
.Cells("B" & RowCount).Offset(0, ShtNum) = _
Sht.Range("P" & c.Row)
End If
Next RowCount
Next ShtNum
End With
End Sub

"Jane Doe" wrote:

Need to find value in column P of multiple worksheets (i.e. may_acct1,
may_acct2, may_acct3) based on phone number in column A of these worksheets
matching phone number in column F of main worksheet and return that value
from column P to column B,C, or D based on worksheet month (may_acct1,
june_acct1 or may_acct2, june_acct2).

Worksheet format to search

column
A................................................. ........................columnP
Subscriber
Number............................................ ...............Subscriber
Total



Worksheet format to return results

column A...(column B, C and D)..................column
E...................column F
Subscriber Total
Name May June July Active Carrier
Subscriber Number


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

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
Scripting Help Jeremy Excel Discussion (Misc queries) 1 September 21st 09 05:57 PM
VBA Scripting dhunter43 Excel Programming 4 October 18th 07 05:01 PM
Error 429 VBA.Interaccion.Createobject("Scripting.FileSystemObject cajinamaster Excel Programming 2 February 14th 07 02:49 PM
VBA - running scripting dictionary (error!) ajliaks[_13_] Excel Programming 4 April 18th 04 10:13 PM
5.6 Scripting Jerry[_11_] Excel Programming 0 July 15th 03 11:55 PM


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