LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 7
Default Discrepancy between manually formatting sheet vs. using VBA macro

I receive a number of tab delimited text files which I need to convert
to Excel spreadsheets. Each file is similar in format: the first line
contains only one entry which is to become the "title" of the report.
The second line contains column headings (always the same) and the
remaining lines contain the variable data; every column in every row
always has a value.

When I format the spreadsheet manually I select A1:M1, Format Cells, and
merge cells, bold, and center horizontally. Then I select A2:M2, Format
Cells, and bold. Then I select column A, Format Cells, bold and custom
numeric format "0000". This produces exactly what I want.

I recorded exactly these operations into a VBA macro. When I run the
macro I see that bold and the custom numeric format are applied to all
columns from A to M.

I guessed that this happens because columns A through M are merged in
row 1 and, sure enough, if I edit the VBA macro so that the operation on
row 1 happens last, it produces the desired result.

My questions a
- why does the VBA macro yield a different result than the commands
that were recorded?
- and is there any way around this, short of editing the the VBA macro?

Thanks,
--
Norm

To reply, change domain to an adult feline.

 
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
manually selected Excel cell formatting TomCU Excel Discussion (Misc queries) 1 January 18th 10 12:58 PM
Creating a template that is manually updated from another sheet. [email protected] Excel Worksheet Functions 6 October 22nd 08 09:27 PM
Auto filter run from a macro will not do the same as when done manually. ChemicalJasper Excel Discussion (Misc queries) 0 February 2nd 07 03:25 PM
Single Sheet - Calculate Manually Charles Williams Excel Programming 1 July 10th 03 05:37 PM
Single Sheet - Calculate Manually Mark Bigelow[_2_] Excel Programming 0 July 8th 03 09:21 PM


All times are GMT +1. The time now is 11:28 AM.

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"