Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Guys,
I have a VBA Macro that works on a sheet and I want to delete from B5 - B17 the problem is that cell A16 is a merged cell (A16 B16 C16) When I use Range("B5:B17).Select it does not select just the cells in column B it selects A5 - C5 down to A17- C17. How can I get it to select only cells B5:B17. If I do it with the mouse directly on the sheet it allows me to do it and ignores the merged cells. Your help is appreciated. Best Regards, Steve Wilson. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Guys,
Sorry, not true, If I do it with the mouse directly on the sheet it does not allow me to do it. If I Mouse Click on Cell B5 and drag to B17 as soon as I pass over the merged cells at B16 it selects columns A & C also. Can I get around this? Thanks, Steve Wilson. l... Hi Guys, I have a VBA Macro that works on a sheet and I want to delete from B5 - B17 the problem is that cell A16 is a merged cell (A16 B16 C16) When I use Range("B5:B17).Select it does not select just the cells in column B it selects A5 - C5 down to A17- C17. How can I get it to select only cells B5:B17. If I do it with the mouse directly on the sheet it allows me to do it and ignores the merged cells. Your help is appreciated. Best Regards, Steve Wilson. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI Steve,
The problem is the the way you learned from the macro recorder code. The extensive use of "Select"is NOT necessary. Use range( "B5:B17).Clear In general the code : asdfsd.select Selection.do_something can be replaced by : asdfasd.do_something Regards JY "Always Learning" <NoMoreSpam@MyEmail wrote in message ... Hi Guys, I have a VBA Macro that works on a sheet and I want to delete from B5 - B17 the problem is that cell A16 is a merged cell (A16 B16 C16) When I use Range("B5:B17).Select it does not select just the cells in column B it selects A5 - C5 down to A17- C17. How can I get it to select only cells B5:B17. If I do it with the mouse directly on the sheet it allows me to do it and ignores the merged cells. Your help is appreciated. Best Regards, Steve Wilson. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There,
This is a good idea but does not give me what I want. It leaves an empty, odd looking column. I have got around this by selecting the merged cells and removing the merge element. Then I do the range selection and delete. Works well and gives me what I wanted. Thanks for your help & time. Best Regards, Steve Wilson. "Jean-Yves" wrote in message ... HI Steve, The problem is the the way you learned from the macro recorder code. The extensive use of "Select"is NOT necessary. Use range( "B5:B17).Clear In general the code : asdfsd.select Selection.do_something can be replaced by : asdfasd.do_something Regards JY "Always Learning" <NoMoreSpam@MyEmail wrote in message ... Hi Guys, I have a VBA Macro that works on a sheet and I want to delete from B5 - B17 the problem is that cell A16 is a merged cell (A16 B16 C16) When I use Range("B5:B17).Select it does not select just the cells in column B it selects A5 - C5 down to A17- C17. How can I get it to select only cells B5:B17. If I do it with the mouse directly on the sheet it allows me to do it and ignores the merged cells. Your help is appreciated. Best Regards, Steve Wilson. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting/Clearing duplicate range of cells | Excel Worksheet Functions | |||
MACRO HELP - deleting rows containing a range of blank cells | Excel Discussion (Misc queries) | |||
Deleting Range name's listed in the range address box. | Excel Discussion (Misc queries) | |||
deleting cells in a range | Excel Programming | |||
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content | Excel Programming |