Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to get ActiveCell's address?

Hello
How to get activecell's address? I need to offset it to (10,0) and paste it.

Sub String_Find_and_Paste()
Dim s_text As String
Dim r As Range
Dim s As Range

For Each c In Worksheets("Sheet1").Rows("5:5").Cells
s_text = c.Value
If InStr(1, s_text, "India", vbTextCompare) 0 Then
'Get the activeCell's address, offset it & paste
Any ideas
Milind


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to get ActiveCell's address?

Hi Milind,

How to get activecell's address? I need to offset it to (10,0)


Try:

Activecell.Offset(10)

---
Regards,
Norman



"Milind" wrote in message
...
Hello
How to get activecell's address? I need to offset it to (10,0) and paste
it.

Sub String_Find_and_Paste()
Dim s_text As String
Dim r As Range
Dim s As Range

For Each c In Worksheets("Sheet1").Rows("5:5").Cells
s_text = c.Value
If InStr(1, s_text, "India", vbTextCompare) 0 Then
'Get the activeCell's address, offset it & paste
Any ideas
Milind




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default How to get ActiveCell's address?

Milind
activecell.offset(10,0).value = activecell.value
or you may mean
c.offset(10,0).value = c.value
(Assumes you just want the value not any formatting or formulas - otherwise
use:
ActiveCell.Copy ActiveCell.Offset(10, 0)
)
cheers
Simon

"Milind" wrote in message
...
Hello
How to get activecell's address? I need to offset it to (10,0) and paste
it.

Sub String_Find_and_Paste()
Dim s_text As String
Dim r As Range
Dim s As Range

For Each c In Worksheets("Sheet1").Rows("5:5").Cells
s_text = c.Value
If InStr(1, s_text, "India", vbTextCompare) 0 Then
'Get the activeCell's address, offset it & paste
Any ideas
Milind




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default How to get ActiveCell's address?

depending on what you want to do there are a couple of options. Often when I
want to interact with the activecell I will set a range object equal to the
active cell. I can move that object around to my little hearts content
without worrying about any consequences to the active cell. Something like
this

Sub String_Find_and_Paste()
Dim s_text As String
Dim r As Range
Dim s As Range
Dim rngCurrent as Range

set rngCurrent = Activecell.offset(10, 0)

For Each c In Worksheets("Sheet1").Rows("5:5").Cells
s_text = c.Value
If InStr(1, s_text, "India", vbTextCompare) 0 Then
c.Copy rngCurrent
set rngcurrent = rngcurrent.offset(1,0) 'If you like
--
HTH...

Jim Thomlinson


"Milind" wrote:

Hello
How to get activecell's address? I need to offset it to (10,0) and paste it.

Sub String_Find_and_Paste()
Dim s_text As String
Dim r As Range
Dim s As Range

For Each c In Worksheets("Sheet1").Rows("5:5").Cells
s_text = c.Value
If InStr(1, s_text, "India", vbTextCompare) 0 Then
'Get the activeCell's address, offset it & paste
Any ideas
Milind



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I avoid excel change absolute address to relative address Miguel Excel Discussion (Misc queries) 3 May 10th 07 11:18 PM
How do I use the ActiveCell's contents as a string for a web query thebird[_2_] Excel Programming 1 June 22nd 05 07:13 AM
long address list, name-address-city, listed vertically, how do y. kb Excel Discussion (Misc queries) 2 March 4th 05 12:48 AM
How do I import Office address book to Outlook Express address bo. snnorp Excel Discussion (Misc queries) 2 February 22nd 05 11:47 AM
LINKING Address cells from an EXCEL spreadsheet to fill MapQuest Address Info Duane S. Meyer Excel Programming 0 August 30th 03 12:16 AM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"