Hi, i have this code below but its not working the way i want it to work. Im trying to select the last used column to 12 columns before that column and hide them. Need help, thanks
Please Login or Register to view this content.
Hi, i have this code below but its not working the way i want it to work. Im trying to select the last used column to 12 columns before that column and hide them. Need help, thanks
Please Login or Register to view this content.
Hi biznez
Wanna give this a try
Please Login or Register to view this content.
Last edited by sintek; 04-05-2017 at 12:30 PM. Reason: Took lastcol setting out of loop
Good Luck
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the star to left of post [Add Reputation]
Also....add a comment if you like!!!!
And remember...Mark Thread as Solved.
Excel Forum Rocks!!!
Hey sinek, im getting error message. Only the first column is hidden and then error message
Did you adapt the code to suite your requirements.i.e. Change
to your sheetname.Please Login or Register to view this content.
Upload your file so that we can take a look.
yes i changed that. it runs fine fo 1st column but error message when looping to next column.
Herewith sample file that tests fine
Since the code looks for the last column in row 1, I'm guessing @biznez's worksheet only has the first column in row 1 filled. thus the code's ability to hide the first column, but then in the next iteration would error at Columns(0). Change Cells(1,) to whatever row better represents the last column of your data.
But of course this is just a guess w/o seeing the data.
I'm interested in starting a career working with VBA, if anyone knows of any opportunities!
Thanks guys the sample file helped
@ walruseggman
That is very possible....Thanks. Did not think of that. It then would defeat the object of he's request....
Im trying to select the last used column to 12 columns before
Glad it helped. thanks for rep points.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks