Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2014, 11:19 PM
ryanjohnsond@gmail.com ryanjohnsond@gmail.com is offline Run Script to remove carriage returns on certain columns Windows 8 Run Script to remove carriage returns on certain columns Office 2007
Novice
Run Script to remove carriage returns on certain columns
 
Join Date: Aug 2014
Posts: 18
ryanjohnsond@gmail.com is on a distinguished road
Default



Quote:
Originally Posted by excelledsoftware View Post
There is a way to run code with all workbooks. I can modify the code I sent you to do this however it is important that when running code on multiple workbooks that they each have similar attributes.

Do all of the workbooks have multiple sheets that need this ran or just the first sheet?
Are all of the workbooks a certain type of name so the code can skip over workbooks that dont meet that criteria?
Are all of the workbooks in one folder? I can research how to get Excel to open and process each file from a folder but the first 2 questions would need to be answered before we do that.

I can write something that will run in all OPEN workbooks pretty easily but you will probably not want to open up 50+ workbooks on your computer.

Thanks
That's fantastic!

>> I can modify the code I sent you to do this however it is important that when running code on multiple workbooks that they each have similar attributes. >>

They all have similar attributes, except the columns start on the 2nd row, and the two columns are the 2nd and 3rd columns.

One other caveat. The column names in the column headers have a carriage return in them (in the header itself), like "Part [carriage return] Number". So, right now, I have to manually rename the headers so that the code finds them. Is there a way to remove the carriage off the header name, rename it without a comma (the name is all on one line) and then do the rest of the removing carriage returns and replacing it with commas?

So the header looks like this:

Part
Number

and needs to look like this (VB script needs to remove the carriage, bring the word "Number" up on the same line as "Part":

Part Number

and then the rest of your code runs...

>>Do all of the workbooks have multiple sheets that need this ran or just the first sheet?>>
Not sure what you mean by "multiple sheets". I am bringing PDFs into Excel and then running the script so a DB can use certain columns for data on a web page. When you say "sheet", do you you mean multiple tabs at the bottom of an Excel file?

>> Are all of the workbooks a certain type of name so the code can skip over workbooks that dont meet that criteria? >>
They're named by part number and part name (numbers first, then name second in one file name string... like this: 42A 500 005 H 006 H Rear axle.pdf, 42A 500 007 H 008 H Wheel carrier assembly for rear axle.pdf, 42A 500 009 F Stabilizer rear axle.pdf, 42A 513 005 F 006 F Shock absorber, rear axle.pdf, etc

>> Are all of the workbooks in one folder? I can research how to get Excel to open and process each file from a folder but the first 2 questions would need to be answered before we do that. >>

There are two separate folders, but I can cut 'n' paste into different folders to reduce the number of files open at a time.

Thank you very much, excelledsoftware.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Script to remove carriage returns on certain columns stop carriage return or enter key in a table Alaska1 Word 1 01-14-2013 08:48 AM
Run Script to remove carriage returns on certain columns Coding into a macro a carriage return sinbad Word VBA 6 02-27-2012 03:51 AM
Run Script to remove carriage returns on certain columns Paragraph (carriage) return font size revrossreddick Word 2 12-28-2011 01:33 PM
Carriage Return Help UCHelp Word 1 04-04-2010 10:11 PM
Run Script to remove carriage returns on certain columns Table of contents, remove spacing and put in 2 columns - need help urgently! nam085 Word 1 03-04-2010 08:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft