473,382 Members | 1,290 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,382 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 2512
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.