Access Excel Worksheet Cells Using VBA

How to Access Excel Worksheet Cells with a Macro Using the Range Property
Before you can start performing calculations with your Excel data, you obviously have to enter data into the worksheet. Now if you wish to enter data with the help of a macro you need to know how to access a worksheet cell like A1 or a range of cells like A1:C1. The ‘range’ property helps you to access a single cell or a range of cells. Later you can define whether a cell can contain text, number, currency, formulas or functions.

  • Click on the ‘Developer’ Tab
  • From the ‘Code’ group select Visual Basic
  • The Microsoft Visual Basic window pops up
  • Click on ‘Insert’ and select ‘Module’.
  • In the white workspace area type ‘Sub macroname()’. Select a macro-name that is short and easy to remember and describes well what the macro will do
  • Press enter and you will notice that the application automatically adds ‘End Sub’
  • Between the ‘Sub macroname ()’ and the ‘End Sub’ you will write the code that will execute what the macro is supposed to do

We enter the following code for example:
Sub range_propert_to_access_worksheet_cells()
Range(“A3”) = “Name”
Range(“B3”) = “Salary”
End Sub

When we click on the run arrow-like button (>) the macro executes the code and after minimizing the MS-Visual Basic Window we can observe that the text ‘Name’ and ‘Salary’ have been placed in the appropriate worksheet cells ‘A1’ and ‘B1’.
Let’s have a look at the MS Excel VBA training video.

13 thoughts on “Access Excel Worksheet Cells Using VBA

  1. mani

    sir i have one question i want pull data from i.e into excel through filter table date enter in excel sheet and run is it possible to do such task in excel vba….

    1. Helene

      dit :Le partie Nazi c’est présenter comme un partie de travailleur, naasnotl-socialiite, amis des syndicats et tous.Mais après qu’il ai pris le pouvoir il a organisé une fête avec les syndicats pour les remercier et en a profiter pour tous les mettre en prison.Comme les communistes…

  2. Kuldeep Dwivedi

    How can I enable macro for a excel sheet, because I’ve created a macro, to click run, it displays a message box indication for enable to macro for this excel sheet.

  3. Pingback: Best Training on Advanced Excel and VBA in Bangalore | jaseemblog

  4. ankit

    I am a professor of finance. I am Chartered Fin. Analyst as well as FInancial Risk Manager.

    I want to purchase the DVDs of your videos for VBA and excel.

    Can you give me your mobile number?

  5. Vikash Roy

    Dear Sir,
    First of all thank you so much for your patience to describe so easily. You are a great person to help with such great effort. I am a guy with willing and keen to learn so i keep searching on internet. Infact i saw you video, that solved most of my search. I have a query kindly explain how to solve it.

    I want to create a form which will save data in sheet 2 but macro button should display in sheet 1. If i click on macro button it should open in sheet 1 and after filling data it should go to sheet 2 worksheet.
    Though i have created the form which is easy to open in sheet 2, however whenever i want to connect with sheet 1 not able to do so.
    please guide me….

    Thank you

    Vikash ROy

    1. Isabelle

      Felices vacaciones Fede!!! A preparase muy bien para el 20332#8&10;. Urgente un psicólogo, un buen preparador físico (empezó muy lento físicamente el 2012, y lo terminó de la misma manera), un buen entrenador, un buen programa de partidos.

  6. ashu

    Dear Sir,

    I have create excel sheet for Computer Management. My first sheet is Computer course content and second sheet is student data. so i have entered data in sheet second then it show me a simple design form so how can make. so please help me..

    thanks & regards,

    1. Dorothy

      En los términos más llanos: es imposible una literatura que sin la postura política que nombra Lola (cómo ella misma dice) siga explorando todas sus pobsiilidades. Ignorar dicha postura, que preferiría llamar perspectiva, equivale a negarnos parte de esa literatura; en términos visuales, seria negarnos a ver la pintura completa, quedarnos en un solo nivel.Para que existan escritores ambiciosos, como Panero (ambicioso en el mejor sentido) también deben existir lectores de esa misma naturaleza.

    2. http://www./

      Que chingue a su puta madre la pinche vieja esa alcayaga, que no joda, como a ella no le afecta en nada sus putas decisiones al igual que a todos los malditos políticos, a ellos les vale madre como se las rasque el pueblo, por mi parte que rechingue a su puta madre la vieja idiota esa.

    3. http://www./

      interests, but given than 99% of Whites probably agree with Auster it's hard to see that as proof of malintent.Exposing this no doubt vexes them. Good.I'm sure Auster would rather live in a magical world where everyone agrees with him and he doesn't have to go to the trouble of dealing with people who don't.So perhaps your presence on the web vexes him.It's extremely unlikely it vexes him enough to matter to his ideational output, though, so why is said vexation "good"?


Leave a Reply

Your email address will not be published. Required fields are marked *