Charlene Turner
Charlene Turner

Reputation: 13

copy a cell value from one worksheet to another as a string

I am trying to copy cell values from Sheets("#sampleTracker") to Sheets("#MESSAGEBOARD").

So datedatax, namedatax, numberdatax are all sourced off the #sampleTracker sheet, then we go to the #MESSAGEBOARD sheet and enter the data at the bottom of a list.

I have got datedatax working, but namedatax and numberdatax are not showing up.

any suggestions?

datedatax = ActiveCell.Value
Dim namedatax As String
Dim numberdatax As String
numberdatax = Sheets("#SampleTracker").Cells(9, ActiveCell.Row).Value
namedatax = Sheets("#SampleTracker").Cells(10, ActiveCell.Row).Value
styledatax = numberdatax + "_" & namedatax


Sheets("#MESSAGEBOARD").Select
Range("C2").Select
Set EmptyCell = Cells(100, ActiveCell.Column) 'select last cell pt1
EmptyCell.End(xlUp).Select ' select last cell in column pt2
ActiveCell.Offset(1, 0).Select ' select last cell in column pt3
ActiveCell.Value = datedatax - Date 'advise how many days till due date
ActiveCell.Offset(0, 1).Select
ActiveCell = "sample " & styledatax

Sheets("#SampleTracker").Select

Upvotes: 1

Views: 4324

Answers (1)

Tim Williams
Tim Williams

Reputation: 166196

You have your row and column reversed in the first part of your code.

It's .Cells(row,column) and it looks like you have .Cells(column,row)

Upvotes: 4

Related Questions