Solved

Rename folder with VBA

Posted on 2011-02-14
3
523 Views
Last Modified: 2012-06-27
I have a folder as follows C:\NewFolder  This is found in Cell A2.
Cell A5 has the path to this folder C:\
I am trying to rename folder 'NewFolder' to 'FolderX'
My code is attached.   I get a File not Found error.
Please tell me what I am doing wrong.  Thanks!

Name (Range("A2").Value As Range("A5").Value & "FolderX"

Open in new window

0
Comment
Question by:davidam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 34889650
Are you sure the path is correct - e.g. it's definitely "NewFolder" and not "New Folder" with a space?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34889661
PS I'm assuming that parenthesis between Name and Range is a typo and isn't actually in your code, since it wouldn't compile otherwise.
0
 

Author Closing Comment

by:davidam
ID: 34889734
Yes, it was just sloppiness on my part.  The code works fine if it is done properly.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filter an Excel list by multiple criteria 6 39
Excel Data Validation Help 9 42
pull a field from a programme into Excel 4 13
Find the duplicates in 29 17
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question