Formula:![]()
Please Login or Register to view this content.
At lineI get the error message "Run-Time Error 13 Type Mismatch" but the entire code still executes normally.Formula:![]()
Please Login or Register to view this content.
Formula:![]()
Please Login or Register to view this content.
At lineI get the error message "Run-Time Error 13 Type Mismatch" but the entire code still executes normally.Formula:![]()
Please Login or Register to view this content.
What is selected?
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Formula:![]()
Please Login or Register to view this content.
That 'Range("A0...") is a problem, for one. That's a zero, not the letter 'O'.
I can't understand the logic of the code you posted. You ask the user to input a string value (Any string will do, it seems) you then add a sheet and name it 'Report' (Possibility that sheet may already exist if the procedure has been run previously - another possible error). You then loop with a check forSelected will never be empty, it is always assigned a value (even if False if the user has canceled input earlier).![]()
Please Login or Register to view this content.
IsEmpty is the wrong function to use here. It is used to check for blank cells or uninitialized variables...
This is also a potential problemYou make absolutely no check that what is entered can be used to refer to a valid range. What if the user enters 'GHGHGHGHH'...? Perhaps you should use the Type = 8 parameter of the Inputbox to ensure the user enters a valid range?![]()
Please Login or Register to view this content.
Last edited by cytop; 03-16-2017 at 03:43 AM.
Sorry, I should have explained it. The input value is a letter for the column you want to select. That column and its adjacent column's value is then copied over to a newly created sheet.
it also stops at 36 instead of 5000
And it seems the values from the 2 columns are concatenated into 1 cell on the destination sheet. Why not take the time to explain (forget code) the exact sequence of events - I'm sure that code you posted can be replaced with something a little more logical.
I haven't used excel for years so I just jumped in and studied what I needed, but I've found a good use for excel now so I know ill learn as I go.
Don't know what s does but lets start from here.
![]()
Please Login or Register to view this content.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks