Results 1 to 6 of 6

Thread: another excel question

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    6
    how do i write data to a specific cell in excel?
    thanks
    Liam

  2. #2
    Fanatic Member VBKNIGHT's Avatar
    Join Date
    Oct 2000
    Location
    Port25
    Posts
    619

    it's easy


    try this..

    Activecell.value = "myText"

    if that doesn't work, you should provide more details of what you are really trying to accomplish.

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    or try this:
    Code:
    Range("A10").Value = "VB-World" 'replace a10 with what cell you want.

  4. #4
    New Member
    Join Date
    Nov 2000
    Location
    Germany, Cologne
    Posts
    3

    Smile

    Isn't ActiveCell.Value reading out? I thought that giving a cell data is done by ActiveCell.FormulaR1C1 = "blabla"...
    Best wishes

    Rubby

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    activecell.value can be used to get the active cell's value or to set it

    i.e
    msgbox activecell.value

    would show the activecells value

    activecell.value = "Hey"

    set the activecells value to "Hey"


  6. #6
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    There are a number of accessing cells in an excel worksheet:

    Reference Meaning
    Range("A1") Cell A1
    Range("A1:B5") Cells A1 through B5
    Range("C59,G9:H16") A multiple-area selection
    Range("A:A") Column A
    Range("1:1") Row one
    Range("A:C") Columns A through C
    Range("1:5") Rows one through five
    Range("1:1,3:3,8:8") Rows one, three, and eight
    Range("A:A,C:C,F:F") Columns A, C, and F

    OR

    Worksheets("Sheet1").Cells(6, 1).Value = 10

    OR

    Reference Meaning
    Rows(1) Row one
    Rows All the rows on the worksheet
    Columns(1) Column one
    Columns("A") Column one
    Columns All the columns on the worksheet

    e.g.
    Code:
    Sub SeveralRows()
    	Worksheets("Sheet1").Activate
    	Dim myUnion As Range
    	Set myUnion = Union(Rows(1), Rows(3), Rows(5))
    	myUnion.Font.Bold = True
    End Sub
    OR

    Worksheets("Sheet1").[A1:B5].ClearContents

    For more help start excel, on the visual basic toolbar click the visual basic editor button. click on help and type
    'referencing cells' in the office assistant, click Search.
    That should give you an link of 'How to reference cells and ranges'. There is a lot of help in there.




    Things I do when I am bored: DotNetable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width