leaving cells blank in a formula

mgovatos

New Member
Joined
Sep 4, 2002
Messages
1
I have just recorded a macro which helps me format data in an excel sheet so I can export that data to a Filemaker Pro file.

One of the functions I use in the formating is "IF(I3="twelfth",12,IF(I3="eleventh",11,IF(I3="tenth",10,IF(I3="ninth",9,""))))". This basically writes 9 for the word "ninth", 10 for "tenth" etcetera.

I created the macro for a excel sheet with 97 rows and now I am trying to use it on an excel sheet with fewer rows (ex. 72). The macro works perfectly, but when I export the data from the 72 row excel spreadsheet, the Filmaker Pro files shows 97 total records. I only want 72 to show.

I have to do this with about 100 spreadsheets all having different numbers of rows. How can I change my formula or macro so that I get blank cells to show up?

Any help would be appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
The macro recorder always records exactly what you do, so the 97 rows will always be selected and processed.

You need to amend the code so that only your 72 (or whatever) rows are selected.

To select down to the last row in column A use this code:

Code:
Range("A1:A" & Range("A65536").End(xlUp).Row).Select

Amend the column references or the start row to suit.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top