ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Go to a given row number (https://www.excelbanter.com/excel-programming/421788-go-given-row-number.html)

Richard_123

Go to a given row number
 
Hello,

In a cell I have a number, which can change. Say it was 75. I then want to
copy the value off one sheet in, say cell A1, and paste it into cell G75 on
another sheet.

I'd like to be able to do this with a macro, so that if the number 75
changes to 30, it will copy cell A1 into cell G30 instead.

Is this possible?

Thanks,
Richard

Lars-Åke Aspelin[_2_]

Go to a given row number
 
On Mon, 29 Dec 2008 08:15:01 -0800, Richard_123
wrote:

Hello,

In a cell I have a number, which can change. Say it was 75. I then want to
copy the value off one sheet in, say cell A1, and paste it into cell G75 on
another sheet.

I'd like to be able to do this with a macro, so that if the number 75
changes to 30, it will copy cell A1 into cell G30 instead.

Is this possible?

Thanks,
Richard



Try this macro:

Sub doit()
Worksheets("Sheet2").Range("G" & Worksheets("Sheet1").Range("B1")) =
Worksheets("Sheet1").Range("A1")
End Sub

Cell B1 on Sheet1 is the cell with your number that can change.

Hope this helps / Lars-Åke




All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com