Macro - add worksheet - copy selected rows - sum last row - name WS same as cell info

jppl2000

New Member
Joined
Dec 29, 2016
Messages
7
Hello.......Thanks in advance for your help.

Name is Jim.

I have a spreadsheet, at least 500 rows. Data is entered one row at a time, manually. There are 8 columns of data, numbers, dates, descriptions, dollar values. Not all cells in this range will contain data. One column will have the option to qualify to contain a letter "t" as an identifier to that row. Of course not all the rows will have a "t".

When all entries have been made, I would like to create a macro that would add a new worksheet, then copy only the rows that have a "t" entered into the select column. Then sum the last row which has dollar amounts and rename the worksheet to a previous text entry on another sheet in a specific cell.

Been a while since I dabbled in vba but am somewhat familiar. Hope to hear from you soon.

Thanks,

JIM
 
Yes, everything works really fine. Your code did a fantastic job. No problems with printing. I believe autosizing columns A, B, C, D, G, is the right term. I noticed that the new worksheet columns were not wide enough for clean views.
Thanks,
JIM
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I've tried the autofit. Column C has text and ends up wrapping. This result makes row too high in size. I've been trying to set row height to autofit but having no luck: added one line. All the remaining data is fine, just column C remains wrapped.
Worksheets("2017").Range("A:E").Columns.AutoFit
Worksheets("2017").Range("C:C").Rows.AutoFit
 
Upvote 0
The only way column "C" row height will increase is if you have some cell in that column formatted to "Wrap Text or a different font size. You cannot have it both ways. Wanting "Wrap Text" and Auto Fit without causing something to happen. Auto fit sets the column width to the smallest possible and still see text. Doing auto fit on rows would look like this:

Code:
Rows("1:20").AutoFit


I've tried the autofit. Column C has text and ends up wrapping. This result makes row too high in size. I've been trying to set row height to autofit but having no luck: added one line. All the remaining data is fine, just column C remains wrapped.
Worksheets("2017").Range("A:E").Columns.AutoFit
Worksheets("2017").Range("C:C").Rows.AutoFit
 
Last edited:
Upvote 0
The correct answer is that there were more than one sized texts on the page and there also were cells with a text wrap command. Both have been eliminated as they were not necessary and the spreadsheet macro is a hit. Thank you very much and Happy New Year!!!
 
Upvote 0
Glad I was able to help you. Come back here to Mr. Excel next time you need additional assistance.
And a Happy New Year to you also.
The correct answer is that there were more than one sized texts on the page and there also were cells with a text wrap command. Both have been eliminated as they were not necessary and the spreadsheet macro is a hit. Thank you very much and Happy New Year!!!
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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