Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie, Positioning according to R1C1 format
I am totally new to Excel VBA.
I have a Sheet1 containing Row number, Column number, and value(3columns). For example, Row number Column Number Value ----------- -------------- -------- 2 6 23.1 4 13 31.9 6 4 51.0 ......... and so on. I wish I could relocate the values(23.1, 31.9, 51.0... ) to the corresponding cells(R1C1 format) on another sheet, for example, Sheet2 of the same Excel book. For example(Sheet2) 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 23.1 3 4 51.0 5 6 51.0 .... Would there be any elegant VBA program for doing this instead of Excel function methods? I really appreciate your help or suggestions to this. Jong |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie, Positioning according to R1C1 format
Dear all,
Sorry for my typo in the example(Sheet2). On the Row4 and Column 13, '31.9' should have been placed instead of '51.0.' Thanks in advance, Jong "Jong" wrote in message ... I am totally new to Excel VBA. ........... corresponding cells(R1C1 format) on another sheet, for example, Sheet2 of the same Excel book. For example(Sheet2) 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 23.1 3 4 51.0 5 6 51.0 ... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie, Positioning according to R1C1 format
Dear gurus,
I will appreciate it if you could give me any hints or key expressions for the VBA program needed for completing this work. Thanks in advance. Jong "Jong" wrote in message ... Dear all, Sorry for my typo in the example(Sheet2). On the Row4 and Column 13, '31.9' should have been placed instead of '51.0.' Thanks in advance, Jong "Jong" wrote in message ... I am totally new to Excel VBA. .......... corresponding cells(R1C1 format) on another sheet, for example, Sheet2 of the same Excel book. For example(Sheet2) 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 23.1 3 4 51.0 5 6 51.0 ... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie, Positioning according to R1C1 format
How about:
Option Explicit Sub testme01() Dim fromWks As Worksheet Dim toWks As Worksheet Dim FirstRow As Long Dim LastRow As Long Dim iRow As Long Set fromWks = Worksheets("sheet1") Set toWks = Worksheets("sheet2") With fromWks FirstRow = 2 ' LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row On Error Resume Next For iRow = FirstRow To LastRow toWks.Cells(.Cells(iRow, "A").Value, .Cells(iRow, "B").Value) _ = .Cells(iRow, "C").Value If Err.Number < 0 Then MsgBox "error with row: " & iRow Err.Clear End If Next iRow On Error GoTo 0 End With End Sub Jong wrote: Dear gurus, I will appreciate it if you could give me any hints or key expressions for the VBA program needed for completing this work. Thanks in advance. Jong "Jong" wrote in message ... Dear all, Sorry for my typo in the example(Sheet2). On the Row4 and Column 13, '31.9' should have been placed instead of '51.0.' Thanks in advance, Jong "Jong" wrote in message ... I am totally new to Excel VBA. .......... corresponding cells(R1C1 format) on another sheet, for example, Sheet2 of the same Excel book. For example(Sheet2) 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 23.1 3 4 51.0 5 6 51.0 ... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro not recording in R1C1 format | Excel Discussion (Misc queries) | |||
Question on this conversion code switching between r1c1 to A1 format tia sal2 | Excel Worksheet Functions | |||
Question on this conversion code switching between r1c1 to A1 format tia sal2 | Excel Discussion (Misc queries) | |||
Question on this conversion code switching between r1c1 to A1 format tia sal2 | Excel Worksheet Functions | |||
R1C1 format using a variable? | Excel Discussion (Misc queries) |