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

I'm writing a small test macro to create folders for Excel files to be
placed in.
I've put the folder names in cells a2:a4. I put the path to the new
folders in C1. here is the code:

Sub MkDirTest()

Dim CtyRange As Range
Dim myCell As Range

Set CtyRange = Range("a2:a4")
For Each myCell In CtyRange.Cells
MkDir Range("c1").Value & Range("A2:a4").Value
Next

End Sub


I'm getting a "Type Mismatch" error when I run the macro on the "MkDir
Range...." line. Can't figure out why? any ideas? Thanks for the help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Range Mismatch

Change to ....

MkDir Range("c1").Value & myCell.Value

HTH


"davegb" wrote:

I'm writing a small test macro to create folders for Excel files to be
placed in.
I've put the folder names in cells a2:a4. I put the path to the new
folders in C1. here is the code:

Sub MkDirTest()

Dim CtyRange As Range
Dim myCell As Range

Set CtyRange = Range("a2:a4")
For Each myCell In CtyRange.Cells
MkDir Range("c1").Value & Range("A2:a4").Value
Next

End Sub


I'm getting a "Type Mismatch" error when I run the macro on the "MkDir
Range...." line. Can't figure out why? any ideas? Thanks for the help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Range Mismatch

Bingo! Thanks, Toppers!

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
Type Mismatch on some PCs Delboy Excel Programming 8 January 17th 05 11:37 AM
Type mismatch in VBA LinEst function if range too large RyanVM[_16_] Excel Programming 4 August 10th 04 02:47 AM
Type Mismatch Rockee052[_60_] Excel Programming 4 March 7th 04 12:12 AM
Type Mismatch Edgar[_3_] Excel Programming 4 February 13th 04 03:55 PM
Mismatch!? Bob[_21_] Excel Programming 1 July 11th 03 02:39 PM


All times are GMT +1. The time now is 09:39 PM.

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"