Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Moving data from Col B to Col A

That means they must not actually be blank. Do you have formulas in them
(not blank). Or did you clear them by hitting the spacebar (not blank).

I ran it on a sheet that actually had blank cells in column A and it worked
perfectly.

Guess you will have to clean up your data or go with Markus's code.

--
Regards,
Tom Ogilvy

"Michael Koerner" wrote in message
...
Tom I tried your macro, and all I got was the message "No blank Cells

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
or, if the cells are really empty/blank, a quicker approach would be

Sub ABCD()
dim cell as Range
On Error Resume Next
for each cell in Activesheet.columns(1).Specialcells(xlBlanks)
cell.Value = Cell.offset(0,1).Value
' uncomment the next line if you want
' the value in B cleared
'cell.Offset(0,1).ClearContents
Next
if err < 0 then
msgbox "No Blank Cells
err.clear
End if
End Sub

--
Regards,
Tom Ogilvy

"Markus Scheible" wrote in message
...
Hi Michael,

try:

For i = 1 To 65532

If Range("a" & i).Value = "" Then Range("a" & i).Value =
Range("b" & i)
End If

Next i

Best

Markus



-----Original Message-----
I need to move the data from Col B to Col A only if the

cell in Col A is empty.
Is there an easy way to do this?

--

Regards
Michael Koerner



.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Moving data from Col B to Col A

Your absolutely correct. Once I cleared the contents of the supposedly blank
cells your macro worked as advertised. Which is good, as I wouldn't know how to
use Markus's code <g

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
That means they must not actually be blank. Do you have formulas in them
(not blank). Or did you clear them by hitting the spacebar (not blank).

I ran it on a sheet that actually had blank cells in column A and it worked
perfectly.

Guess you will have to clean up your data or go with Markus's code.

--
Regards,
Tom Ogilvy

"Michael Koerner" wrote in message
...
Tom I tried your macro, and all I got was the message "No blank Cells

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
or, if the cells are really empty/blank, a quicker approach would be

Sub ABCD()
dim cell as Range
On Error Resume Next
for each cell in Activesheet.columns(1).Specialcells(xlBlanks)
cell.Value = Cell.offset(0,1).Value
' uncomment the next line if you want
' the value in B cleared
'cell.Offset(0,1).ClearContents
Next
if err < 0 then
msgbox "No Blank Cells
err.clear
End if
End Sub

--
Regards,
Tom Ogilvy

"Markus Scheible" wrote in message
...
Hi Michael,

try:

For i = 1 To 65532

If Range("a" & i).Value = "" Then Range("a" & i).Value =
Range("b" & i)
End If

Next i

Best

Markus



-----Original Message-----
I need to move the data from Col B to Col A only if the

cell in Col A is empty.
Is there an easy way to do this?

--

Regards
Michael Koerner



.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving a line chart data point revises data table value in Excel ' Ed Smith Charts and Charting in Excel 2 November 16th 12 01:03 PM
Moving Data between sheets in the same workbook and moving data between Workbooks. Alison Brown Excel Worksheet Functions 0 February 10th 09 01:03 AM
Moving data from one worksheet to another whilst removing the data Dobbin0_4[_2_] Excel Discussion (Misc queries) 2 September 17th 08 03:31 PM
moving data to non autofarmatted book changes data- Why? Josh Excel Discussion (Misc queries) 3 March 10th 06 09:16 PM
moving data in excel without deleting existing data jigna Excel Discussion (Misc queries) 1 January 30th 05 11:35 AM


All times are GMT +1. The time now is 01:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"