Is there a way to select cells that only have data in them? trying to write a macro that selects data but the amount of rows changes depending on the day. thanks for any help I can get.
that will select all the cells on the active sheet that contain number values or text values. To select formulas would be a bit different.
What will you do with these cells once you select them? It's quicker, and uses less lines of code to perform and action on a range directly, rather than .Select it, and do something to .Selection.
thanks for your help. what i plan on doing is taking data entry inputs, copying it into a different format to print. the problem that i was having was that there are a different amount of entries day to day and i didn't was to copy blank cells.I will try to see if i can get one of these to work. I actually have 16 columns that have to be copied with each row.
thanks again.
TazGuy, I would like to try to use your code. I am new at this, how would I set this up in VB to run. Do I put it into a module?? I am really not sure. any help you could give me would be great.
thanks again
You could put it in a standard module, or in event code. It really depends on what you're trying to accomplish. If you can, you should incorporate it with other code, so you don't have extra modules hanging around that only do one thing.
TazGuy, I did get it to work. Do you know if there is a way to select all data and any empty cells that are in between. for instance if there is data in a1 and a3 it will grab a1, a2 and a3. I tried to use acw's code to see if it would do that but I couldn't get it to work. thanks for your help.
Royboy531
TazGuy, This did work but not quite the way I wanted to. lets say I have info from a1 to a7 and from b1 to b6 is there a way I can select data from a1 to b7 in a way that the row number may change. could by 10 rows or 15. I am not sure if this is clean and I don't know how to post an pic of worksheet but I could do my best if I need to explain further.[/list]
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.