473,549 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel Macros

2 New Member
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 2520
michelle
11 New Member
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
dave ellis
3 New Member
: 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
5816
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) documents successfully. Is there anything we have to take care of, while handling uploads of excel documents with macros? Thanks in advance,
3
2345
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 one central Excel macro repository. What would you guys suggest me do? Should I keep all macros in a centralized unique text file of some sort or...
1
2598
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#). I guess I need to describe how I used the DLL in Excel to motive this discussion
3
1448
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 of spreadsheets with macros that I would like to deliver to people via a web application(read only for now maye not in the future).... Some...
0
2343
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 trouble getting the macros to work on her pc. The macro is not too fancy - it just reads the data in the Excel file, send the keystrokes to the mainframe,...
3
3991
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 2000, but in Office 2003 crash at line: "wbc = workbook.VBProject.VBComponents.Add(1)" Please help me :-( the code of the module that crash is...
6
4951
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. Some contain many worksheets and various macros. What I'd like to do is extract the data and business logic so that I can figure out exactly what...
4
4389
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 functions with the data. I want to be able to open an Access form that I created, and then hit a button that will run the macros and that will open...
8
14069
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 created? For example, usually the macros are manually done: Go to Tools, Macros – Macro. Select the “Automate” macro and click “run”. However I am...
8
5342
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 excel I get the error Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following...
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5089
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.