Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
Hi!
I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) Second: How do i position myself in a cell? Let's say cell K15. Thanks to everyone who is willing to help! Marko Svaco |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
"marko" wrote in message ... Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) LastCell = Range("A1").End(xlRight) Second: How do i position myself in a cell? Let's say cell K15. Range("A1").Select |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
Marko
Hope this helps: Sub a() Dim Lastcol As Integer, Lastrow As Long ' Last non-blank column in row 1 ' If columns A,B have data, C is blank, D has data then Lastcol=4 i.e. Column D Lastcol = Cells(1, Columns.Count).End(xlToLeft).Column 'last row in column 1 .. last non-blank column starting from bottom of column Lastrow = Cells(Rows.Count, 1).End(xlUp).Row ' data in K15 Range("k15") = 1234 ' cells(row,column) Cells(15, "K") = 1234 Cells(15, 11) = 1234 End Sub "marko" wrote: Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) Second: How do i position myself in a cell? Let's say cell K15. Thanks to everyone who is willing to help! Marko Svaco |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
Thanks!!
And how can i go one cell to the right? To B1. Thanks! Marko "Bob Phillips" wrote in message ... "marko" wrote in message ... Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) LastCell = Range("A1").End(xlRight) Second: How do i position myself in a cell? Let's say cell K15. Range("A1").Select |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
Activecell.Offset(0,1)
-- HTH RP (remove nothere from the email address if mailing direct) "marko" wrote in message ... Thanks!! And how can i go one cell to the right? To B1. Thanks! Marko "Bob Phillips" wrote in message ... "marko" wrote in message ... Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB ..NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) LastCell = Range("A1").End(xlRight) Second: How do i position myself in a cell? Let's say cell K15. Range("A1").Select |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
THANKS!!!!!
"Bob Phillips" wrote in message ... Activecell.Offset(0,1) -- HTH RP (remove nothere from the email address if mailing direct) "marko" wrote in message ... Thanks!! And how can i go one cell to the right? To B1. Thanks! Marko "Bob Phillips" wrote in message ... "marko" wrote in message ... Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) LastCell = Range("A1").End(xlRight) Second: How do i position myself in a cell? Let's say cell K15. Range("A1").Select |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
About going through all the cells in a sheet....
It helped me a lot!!!
Thanks! Marko "Toppers" wrote in message ... Marko Hope this helps: Sub a() Dim Lastcol As Integer, Lastrow As Long ' Last non-blank column in row 1 ' If columns A,B have data, C is blank, D has data then Lastcol=4 i.e. Column D Lastcol = Cells(1, Columns.Count).End(xlToLeft).Column 'last row in column 1 .. last non-blank column starting from bottom of column Lastrow = Cells(Rows.Count, 1).End(xlUp).Row ' data in K15 Range("k15") = 1234 ' cells(row,column) Cells(15, "K") = 1234 Cells(15, 11) = 1234 End Sub "marko" wrote: Hi! I'm a newbie in excel but I'm learning and i would apriciate if someone would help me. I know something from the VB code because i work a little bit in VB .NET so i just need some instructions for the VB references (my english is bad, so i don't know which word to use) for excel. First: In the first row I would like to determine which cell is the last with any data(but only the first row, row 1). And in the first column I would like to determine which row is the last with any data(but only the first column, column A) Second: How do i position myself in a cell? Let's say cell K15. Thanks to everyone who is willing to help! Marko Svaco |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel: match two cells in one sheet to two cells in another and return a third cells value | Excel Worksheet Functions | |||
How do I link cells, sheet to sheet, to recognize row deletions? | Excel Discussion (Misc queries) | |||
Copy Sheet to new Sheet and clear cells on original sheets | Excel Discussion (Misc queries) | |||
Copying cells from on sheet to another sheet (via sheet module) | Excel Programming | |||
Copy row sheet-sheet skipping unqualified cells | Excel Worksheet Functions |