Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2016, 05:50 PM
cloudforgiven cloudforgiven is offline Button does not generate proper colors? Windows XP Button does not generate proper colors? Office 2013
Novice
Button does not generate proper colors?
 
Join Date: Nov 2016
Posts: 13
cloudforgiven is on a distinguished road
Default

I am trying to just generate 1 column and 1 row at the end of a table at the click of a button(since the people using the spreadsheet are computer illiterate). your code does this meaning I can implement it into one button however, for some reason since the table alternates colors meaning one row gray, the other light gray, the code adds the correct column with the correct color, but the row it generates always has the same color
FYI the text is just there for testing.
Notice only column A is the only column that alternates while B21-B26, all the way to the rows L21-L26 and so on and so forth do not?


I need the Generated rows color to alternate just like the previous rows. Dont worry about the columns because those work its just the rows.

And thank you for helping me this far because you eliminated the need for having 2 buttons and even a user input.

Last edited by cloudforgiven; 12-22-2016 at 09:58 PM.
Reply With Quote
  #2  
Old 12-22-2016, 07:22 PM
NoSparks NoSparks is offline Button does not generate proper colors? Windows 7 64bit Button does not generate proper colors? Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Looks to me like you may have missed the red part of this line
Code:
.Range(Cells(EndRow + 1, StrtCol), Cells(EndRow + 1, EndCol + 1)).Interior.Color = _
                            .Cells(EndRow - 1, StrtCol).DisplayFormat.Interior.Color
The right color is being applied but only to the starting cell of the range.

It would be far easier to be sure if you would post the sheet with the code rather than a picture of the sheet and no code. (This isn't MrE. Excel files can be posted here.)

On second thought that's not right. The new row being added is not always immediately below "the table".
I'll have to adjust for that.... I'll be back shortly.

Last edited by NoSparks; 12-22-2016 at 07:29 PM. Reason: second thoughts
Reply With Quote
  #3  
Old 12-22-2016, 07:47 PM
cloudforgiven cloudforgiven is offline Button does not generate proper colors? Windows XP Button does not generate proper colors? Office 2013
Novice
Button does not generate proper colors?
 
Join Date: Nov 2016
Posts: 13
cloudforgiven is on a distinguished road
Default

ok and thank you for helping me this far. here is file

Last edited by cloudforgiven; 12-22-2016 at 09:58 PM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
proper snoforlife Excel Programming 0 01-26-2016 02:16 PM
Button does not generate proper colors? Hyperlinks Not Linking to Proper Sections of Doc MoiraB Word 2 08-26-2015 07:13 PM
Proper Text Format sufian,naeem Excel 1 05-05-2014 05:59 AM
Button does not generate proper colors? Unable to change font colors from theme colors choy Word 3 08-01-2012 09:12 PM
Button does not generate proper colors? Proper Excel Table of Contents (ToC) judicial85 Excel 1 10-23-2011 01:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:26 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