Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

How to reference an active cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tomáš Vognar - 11 Mar 2008 12:19 GMT
I've recorded a simple macro for Excel, where I work with a row. But I want
to work with a row the active cell is on, but Macro Recorder has writen me
an absolute referencing. Should anyone help me, how to rewrite the code?

Sub Zašedění_řádku()
   Range("A12:W12").Select    !!!
   With Selection.Interior
       .ColorIndex = 15
       .Pattern = xlSolid
   End With
End Sub

Signature

Tomas Vognar, beginner, Office XP

Bob Phillips - 11 Mar 2008 12:42 GMT
Sub Za¹edìní_øádku()
   With Activecell.Entirerow.Interior
       .ColorIndex = 15
       .Pattern = xlSolid
   End With
End Sub

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> I've recorded a simple macro for Excel, where I work with a row. But I
> want
[quoted text clipped - 8 lines]
>    End With
> End Sub
Tomáš Vognar - 12 Mar 2008 09:34 GMT
Thank you very much, it works. But is it possible to rewrite it, so that
limited row was marked? (Since Ay to Wy, or using CurrentRegion)

T.Vognar

> Sub Zašedění_řádku()
>    With Activecell.Entirerow.Interior
[quoted text clipped - 16 lines]
>>    End With
>> End Sub
Bob Phillips - 12 Mar 2008 23:59 GMT
I am not understanding. Ay to Wy, what is that referring to?

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Thank you very much, it works. But is it possible to rewrite it, so that
> limited row was marked? (Since Ay to Wy, or using CurrentRegion)
[quoted text clipped - 21 lines]
>>>    End With
>>> End Sub
Tomáš Vognar - 14 Mar 2008 09:24 GMT
The best would be region defined by intersection of the CurrentRegion and
active line. I'm sorry, I'm trying this, but I get errors or wrong results.
I do not quite understand the syntax of the VBA, for the meantime.

T.Vognar

>I am not understanding. Ay to Wy, what is that referring to?
>
[quoted text clipped - 24 lines]
>>>>    End With
>>>> End Sub
JP - 14 Mar 2008 21:56 GMT
Sub Za¹edìní_øádku()
   With Range("A12:W12").Interior
       .ColorIndex = 15
       .Pattern = xlSolid
   End With
End Sub

--JP

> The best would be region defined by intersection of the CurrentRegion and
> active line. I'm sorry, I'm trying this, but I get errors or wrong results.
> I do not quite understand the syntax of the VBA, for the meantime.
>
> T.Vognar

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.