Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jim May
 
Posts: n/a
Default Why type mismatch - R/T error 13

I was/am trying to assist a previous OP (you'll possibly see it below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Try being more explicit:

For Each c In TargRange
becomes
For Each c In TargRange.Cells

And .usedrange.columns(1) may be column A. I think the OP wants to check column
B.

(And don't forget to "dim C as range" <vbg.)

Jim May wrote:

I was/am trying to assist a previous OP (you'll possibly see it below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!


--

Dave Peterson
  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

ps. before you do that change, try adding
msgbox c.address

and you'll see why it blows up. Trying not to give it away. That type of range
doesn't have a .value.

Dave Peterson wrote:

Try being more explicit:

For Each c In TargRange
becomes
For Each c In TargRange.Cells

And .usedrange.columns(1) may be column A. I think the OP wants to check column
B.

(And don't forget to "dim C as range" <vbg.)

Jim May wrote:

I was/am trying to assist a previous OP (you'll possibly see it below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Jim May
 
Posts: n/a
Default

Thanks Dave for the help.
Before your ps note (below) I had already modified code so unable to try
"msgbox c.address" suggestion. Now realize how any "For each" needs
".cells" on end of a set rng. I'm getting there - thanks to guys like
you...
Jim May

"Dave Peterson" wrote in message
...
ps. before you do that change, try adding
msgbox c.address

and you'll see why it blows up. Trying not to give it away. That type of

range
doesn't have a .value.

Dave Peterson wrote:

Try being more explicit:

For Each c In TargRange
becomes
For Each c In TargRange.Cells

And .usedrange.columns(1) may be column A. I think the OP wants to

check column
B.

(And don't forget to "dim C as range" <vbg.)

Jim May wrote:

I was/am trying to assist a previous OP (you'll possibly see it

below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!


--

Dave Peterson


--

Dave Peterson



  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

It doesn't always need it. But if you want to cycle through the cells, it never
huts to add it.

On the other hand, if you want to cycle through colums/rows, you can .columns or
..rows at the end.



Jim May wrote:

Thanks Dave for the help.
Before your ps note (below) I had already modified code so unable to try
"msgbox c.address" suggestion. Now realize how any "For each" needs
".cells" on end of a set rng. I'm getting there - thanks to guys like
you...
Jim May

"Dave Peterson" wrote in message
...
ps. before you do that change, try adding
msgbox c.address

and you'll see why it blows up. Trying not to give it away. That type of

range
doesn't have a .value.

Dave Peterson wrote:

Try being more explicit:

For Each c In TargRange
becomes
For Each c In TargRange.Cells

And .usedrange.columns(1) may be column A. I think the OP wants to

check column
B.

(And don't forget to "dim C as range" <vbg.)

Jim May wrote:

I was/am trying to assist a previous OP (you'll possibly see it

below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Jim May
 
Posts: n/a
Default

Dave thanks you for the response; I actually understood what
you were saying as I read your words << this is a rarity - for me.
appreciate you,
Jim

As i read your
"Dave Peterson" wrote in message
...
It doesn't always need it. But if you want to cycle through the cells, it

never
huts to add it.

On the other hand, if you want to cycle through colums/rows, you can

..columns or
.rows at the end.



Jim May wrote:

Thanks Dave for the help.
Before your ps note (below) I had already modified code so unable to try
"msgbox c.address" suggestion. Now realize how any "For each" needs
".cells" on end of a set rng. I'm getting there - thanks to guys like
you...
Jim May

"Dave Peterson" wrote in message
...
ps. before you do that change, try adding
msgbox c.address

and you'll see why it blows up. Trying not to give it away. That

type of
range
doesn't have a .value.

Dave Peterson wrote:

Try being more explicit:

For Each c In TargRange
becomes
For Each c In TargRange.Cells

And .usedrange.columns(1) may be column A. I think the OP wants to

check column
B.

(And don't forget to "dim C as range" <vbg.)

Jim May wrote:

I was/am trying to assist a previous OP (you'll possibly see it

below) -
anyhow
my code at present is bombing at the last line presented below:
Any assistance appreciated..

Sub Tester()
Dim CurrDate As Date
Dim Nxtrow As Long
Dim TargRange As Range
CurrDate = Sheets("CallerInput").Range("B29")
Set TargRange = Worksheets("Infoloader").UsedRange.Columns(1)
For Each c In TargRange
If c.Value = CurrDate Then <<<<<<<<< Bomb !!

--

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
Pivot Chart: cannot apply the default chart type... doco Charts and Charting in Excel 1 January 17th 05 04:55 PM
Adding a line Chart Type to a stacked-clustered Chart Type Debbie Charts and Charting in Excel 2 January 5th 05 11:25 PM
how can i type the numbers in arabic or farsi format مثل 1233 zari Excel Discussion (Misc queries) 0 January 4th 05 05:37 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
How to I use ** without Excel thinking I want to type a formula? Buff Excel Discussion (Misc queries) 2 December 22nd 04 09:31 PM


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