hi all,
can someone help me with simple code
i need a code to select a cell range in active row;
thanks
Printable View
hi all,
can someone help me with simple code
i need a code to select a cell range in active row;
thanks
Given .Cells(n) where n is a column numberCode:ActiveCell.EntireRow.Cells(n).Select
thanks SamT,
so instead of entire row if i want to specify range A-E what needs to be changed there?
Hi Torpido.
I don't want to sound rude, but this is a VBA Help Site, not a School.
There are thousands of tutorials out there on the web, I suggest you spend some time learning the basics of VBA.
There is also a Macro Recorder in Excel. Try that. Google is your buddy!
sorry but i dont have much use of VBA this is just small thing on my hand, nothing that i cant live without but it would be a help if this is done; Micro recorder... tried it, unfortunitly i dont have just a Row its whole sheet so do the math :crying::(
Btw google brought me here!:hi:
Code:Range("A" & ActiveCell.Row & ":E" & ActiveCell.Row).Select
We Help. We Teach. We Guide. We Tutor. We Train. We Blog. We produce a Newsletter. We Consult. We produce videos. We hold Webinars. We provide complete integrated MS Office applications.Code:ActiveCell.EntireRow.Range("A1:E1").Select
VBA Express is so much more than just a help forum.
http://www.vbaexpress.com/
http://www.vbaexpress.com/training.html
http://www.vbaexpress.com/excel-academy.html
https://www.youtube.com/user/VBAExpress/
.
I stand corrected
thanks Paul, it worked like charm... mybe you motivate me to learn VB after all:clap::clap:
also thanks SamT, kind words
VBA is a very powerful tool to have in the toolbox, it is well worth the effort of learning it :thumb
hey Paul :hi:
just one more quick one, please
in above code, after selecting A to E, ive added to copy the selection, then i want it to go to select column F Next row
thanks
duplicate post
after selecting A to E, ive added to copy the selection, thereafter i want it to select Cell "F" of row below
So maybe explain what you want to do, including the selecting A to E, which normally should not be required.
Some examples:
orCode:Range("F1:J1").Value = Range("A1:E1").Value
orCode:Cells(1, 1).Resize(, 5).Copy Cells(1, 6)
and a lot other possibilities.Code:Cells(1, 6).Resize(, 5).Value = Cells(1, 1).Resize(,5).Value
this worked
range("F" & ActiveCell.Row + 1).Select
thanks all