Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
rn rn is offline
external usenet poster
 
Posts: 2
Default Formatting data

Hi

When formatting the same type of data frequently, I
design a template with three sheets, the first to paste
the raw data, the second a temporary for the
fuctions/formulas for fomatting the data in the former
sheet and the last sheet is to paste the temporary sheet
data as values. Please see example below.

In the second sheet I write the formulas for more than
the rows of expected data. Say somtimes 200 rows as the
rows of data varies from 10 to 150.

My questions are,

1. Is this the most efficient way of doing this task?
If not what is a better solution.

2. How can I adapt my function/formula sheet to only
write fuction/formulas only for the number of rows in the
data sheet?


Data sheet

ID CustName ProductCode
12 Joe Bloggs FEN

Temporary sheet

ID ProductName
12 Fulltime English (This name is derived from the
ProductCode in the Data Sheet and a lookup table using
the Vllookup function)

Final sheet
Just copies the Temporary sheet as values using macros.

Thanks.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Formatting data

Like many things in the world of computing there are many paths to reach the
same goal, all with different advantages/disadvantages; you could do all of
this by hard-coding the formatting and formulas, if you wanted to, and
perhaps there might be some benefit to that (smaller file size? Faster
execution?) - but "if it ain't broke, don't fix it!" It seems to me your
approach is much easier to set up, less prone to "bugs", and a lot easier to
maintain (for example, you can easily change formatting without having to
work out the code). I think sometimes we programmers (I include myself here)
get so hung up on coding a solution we ignore the possibility of some
creative solutions using only standard Excel features.

And you can enhance the solution with code as needed, which addresses your
second question. Again, there are many approaches. You could step through
your data row by row, into the formula/formats range on your temp sheet, then
copy and paste formats and values to the result sheet; or you could duplicate
your formatting and formulas on the temp sheet to match the number of rows on
the original sheet and do it all in one operation after that. In fact, you
could apply the formulas and formatting to your entire temp sheet and then
only copy/paste the number of rows you need: assuming you have set up the
temp sheet this way, it would just be something like this:

Sheets("MainSheet").Range("DataRange").Copy
Sheets("TempSheet").Range("A1").PasteSpecial xlPasteValues
Sheets("TempSheet").Range("ResultRange").Copy
Sheets("FinalSheet").Range("A1").PasteSpecial xlPasteValues
Sheets("FinalSheet").Range("A1").PasteSpecial xlPasteFormats

And, if you need to find the range, assuming you have a continuous list and
you know where it starts (but not necessarily where it ends) you can use the
CurrentRegion; for example, if the formulas and formats you are using on your
temp sheet start in cell A1, and form a rectangular region with no blank rows
or columns, you can use Sheets("TempSheet").Range("A1").CurrentRegion.Copy to
copy the whole list at once.

Don't know if this will all work for your spreadsheet, but a few ideas to
think about at least...

"rn" wrote:

Hi

When formatting the same type of data frequently, I
design a template with three sheets, the first to paste
the raw data, the second a temporary for the
fuctions/formulas for fomatting the data in the former
sheet and the last sheet is to paste the temporary sheet
data as values. Please see example below.

In the second sheet I write the formulas for more than
the rows of expected data. Say somtimes 200 rows as the
rows of data varies from 10 to 150.

My questions are,

1. Is this the most efficient way of doing this task?
If not what is a better solution.

2. How can I adapt my function/formula sheet to only
write fuction/formulas only for the number of rows in the
data sheet?


Data sheet

ID CustName ProductCode
12 Joe Bloggs FEN

Temporary sheet

ID ProductName
12 Fulltime English (This name is derived from the
ProductCode in the Data Sheet and a lookup table using
the Vllookup function)

Final sheet
Just copies the Temporary sheet as values using macros.

Thanks.




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
Formatting ALL data labels for ALL data series at once Vasco Charts and Charting in Excel 8 April 3rd 23 02:41 PM
Formatting data series - line between certain data points only alan_m Charts and Charting in Excel 0 September 20th 07 05:16 PM
Formatting Rows of Data based on Column Data mwmasch Excel Worksheet Functions 3 July 24th 07 04:36 PM
How can I cut data out of HTML table, into msExcel and just take the data & columns? (but NOT the formatting & URLs!) ship Excel Discussion (Misc queries) 24 April 25th 06 06:02 PM
Data Formatting Programmer wanna be Excel Programming 4 July 29th 04 08:27 PM


All times are GMT +1. The time now is 06:37 AM.

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"