473,242 Members | 1,837 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Excel Macros

What is the problem with the macro : below

Expand|Select|Wrap|Line Numbers
  1. Sub M()
  2.  
  3. C = Worksheets("SHEET1").Range("B5")
  4. C = ActiveCell
  5. My_row = ActiveCell.Row
  6.  
  7. End Sub
I would like that excel give me back the information of My_Row=5, because that is the row of the Range B5. How can I do this?

:confused:
Aug 28 '06 #1
2 2507
Hello eduardo,

Try this:

Expand|Select|Wrap|Line Numbers
  1. C = Worksheets("SHEET1").Range("B5").Select
  2. C = ActiveCell
  3. My_row = ActiveCell.Row
Nice regards,
Michelle.
Aug 28 '06 #2
: below


I would like that excel give me back the information of My_Row=5, because that is the row of the Range B5. How can I do this?

:confused:
Expand|Select|Wrap|Line Numbers
  1. Sub M()
  2.  
  3. C = Worksheets(1).Range("B5").Address
  4. My_Row = Range(C).Row
  5.  
  6. MsgBox C       ' you may remove these two lines when finished testing
  7. MsgBox My_Row  ' you may remove these two lines when finished testing
  8.  
  9. Range(C).Offset(0, 0).Value = C & ", " & My_Row 
  10. ' modify the (0, 0) to read (0, 1) for example, and you can see the result being placed to the right of the C range instead of within it
  11.  
  12. End Sub
  13.  
  14.  
you can now modify this in your choice of ways, to arrive more closely at the result you wanted.
Sep 4 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Prakash | last post by:
Hi, We face problems uploading excel (with macros) documents using HTML File Upload. The file contents are corrupted while viewing the same. However, we are able to upload excel (w/o. macros)...
3
by: OhMyGaw | last post by:
Hello Excel/automation Gurus, I am working on an application where I have to keep a centralized database of all macros distributed to user and save the changes back on a nightly basis back to...
1
by: Dartish | last post by:
Hi all, Thanks in advance for the help I have a DLL that which has several functions that I can call in Excel. I am thinking of how to call these functions in a .net project (authored in C#)....
3
by: jeremy.bird | last post by:
I am looking for a possible solution or bump in the right direction when working with excel on the web. Currently I am using and developing in visual studio 2005. Here is the situation I have a lot...
0
by: husky81 | last post by:
Greetings: I have Excel 2000 on my work pc. I've written some macros using the sendkeys command to control a mainframe application. A co-worker has Excel 2003. She seems to have a lot of...
3
by: dan_roman | last post by:
Hi, I developed a script with a nice interface in Tkinter that allows me to edit some formulas and to generate an Excel worksheet with VBA macros within it. The script runs perfectlly in Office...
6
by: Duncan Smith | last post by:
Hello, I am currently implementing (mainly in Python) 'models' that come to me as Excel spreadsheets, with little additional information. I am expected to use these models in a web application. ...
4
by: Suzette | last post by:
I have an excel file that automatically updates when opened, pulling information from an Access database into into various pivot tables. I created a macro in Access to perform various necessary...
8
by: dr3586 | last post by:
Hi, I have an Oracle PL/SQL procedure that extracts data into an excel worksheet. I am wondering if there is anyway from the procedure to also set the macros of the excel document that is...
8
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a web site that automates excel. This site runs in server 2003. iis 6.0 office 2003 installed I moved this app to server 2008 iis 7.0 office 2003 installed Now when I try to automate...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.