SELECT CELL AND SEND THAT INFO TO ANOTHER CELL

  • Thread starter Thread starter Rv
  • Start date Start date
R

Rv

i'm tring to to be able to slect a cell and have and the information (in the
cell) copied to another designated cell.
 
You can put in this line into the designated cell;

= A1
Or if the cells are in different worksheets:

= Sheet1!$A1

I usually use an IF statement to validate them but any will work

= IF(B10= "","", B10)
 
for a macro solution, try:
==========================
Option Explicit

Sub select_copy()

Dim wb As Workbook
Dim ws As Worksheet
Dim myFirstRange As Range
Dim mySecondRange As Range

Set wb = ActiveWorkbook
Set ws = ActiveSheet
Set myFirstRange = ws.Range("B3") 'change range to suit
Set mySecondRange = ws.Range("D3") 'change range to suit

myFirstRange.Copy Destination:=mySecondRange

End Sub
====================================
hth
susan
 
(actually, i forgot the select, i'm so used to not using them!
just add in

myFirstRange.select

before the copy/paste business).

susan
 
sub CopyStuff
Activecell.copy Destination:=Sheets("Sheet1").Range("A1")
end sub

The above sub copies the active cell to cell A1 on sheet 1. If you only want
the value to move and not the formula and formatting then prehaps this...

sub CopyStuff
Sheets("Sheet1").Range("A1").value = activecell.value
end sub
 
Selecting the range before copying it (via the Copy method) is not
required... your originally posted code works fine as written. However, I
think the OP wants the copy process to work with the currently selected
cell(s), not a preselected range. I'd change your code to something like
this...

Sub select_copy()
Selection.Copy Destination:=ActiveSheet.Range("D3") 'change to suit
End Sub

Rick


(actually, i forgot the select, i'm so used to not using them!
just add in

myFirstRange.select

before the copy/paste business).

susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top